+ Reply to Thread
Results 1 to 7 of 7

Thread: Run 41 regression at one time

  1. #1
    Points: 482, Level: 9
    Level completed: 64%, Points required for next Level: 18

    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Run 41 regression at one time



    Hello,

    I have a data set 41 days data.
    There are 14 columns. And the first column is Date. Second column is Y and the rest are X's.

    Sorry to ask something so basic, but are we able to run regression for each day at one time?
    I have attached file.

    Thank you for your time and effort.
    Attached Files

  2. #2
    Points: 482, Level: 9
    Level completed: 64%, Points required for next Level: 18

    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Run 41 regression at one time

    Sorry, there should be about 30 days data, not 41 days.
    Thanks

  3. #3
    Points: 2,626, Level: 31
    Level completed: 18%, Points required for next Level: 124

    Location
    Dallas, TX
    Posts
    311
    Thanks
    12
    Thanked 94 Times in 93 Posts

    Re: Run 41 regression at one time

    If the question is just that can you run a regression for each day then answer is yes. There are many different procedures for this depending on what kind of regression are you trying to run. Is it simple OLS or are you trying to run autoregressive models(arma/arima/garch). The second consideration is that do you have enough observations for each day?

    Technically you can run any type of regression using SAS if you understand what you need. If you've already worked on some proc or code then do share it.

  4. The Following User Says Thank You to jrai For This Useful Post:

    whsieh (02-19-2012)

  5. #4
    Point Mass at Zero
    Points: 5,855, Level: 49
    Level completed: 53%, Points required for next Level: 95
    ledzep's Avatar
    Location
    Berks,UK
    Posts
    635
    Thanks
    169
    Thanked 130 Times in 128 Posts

    Re: Run 41 regression at one time

    The use of "by" statement must do it. I don't know what sort of model (simple regression or some time series modelling) you're trying to fit to the data but take simple linear regression as an example.

    Code: 
    proc reg data=nameofyourdata;
    model y = x1-x10;
    by date;
    run;
    
    *This should give you the results of regression model you've fitted at each dates separately;
    As jrai nicely summed up: "you can run any type of regression using SAS if you understand what you need".

    PS: To be precise, the data have 29 days

    Code: 
    
    Class       Levels  Values
    
    date            29  1/10/11 1/11/11 1/12/11 1/3/11 1/4/11 1/5/11 1/6/11 1/7/11 12/10/10 12/13/10
                        12/14/10 12/15/10 12/16/10 12/17/10 12/2/10 12/20/10 12/21/10 12/22/10 12/23/10
                        12/27/10 12/28/10 12/29/10 12/3/10 12/30/10 12/31/10 12/6/10 12/7/10 12/8/10
                        12/9/10
    Oh Thou Perelman! Poincare's was for you and Riemann's is for me.

  6. The Following User Says Thank You to ledzep For This Useful Post:

    whsieh (02-19-2012)

  7. #5
    Points: 482, Level: 9
    Level completed: 64%, Points required for next Level: 18

    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Run 41 regression at one time

    Hi guys,

    Thank you for reply.

    Yes, I meant run regression by date. And there are 416 observations for each date. Simple OLS is what I need.

    Thank you

  8. #6
    Point Mass at Zero
    Points: 5,855, Level: 49
    Level completed: 53%, Points required for next Level: 95
    ledzep's Avatar
    Location
    Berks,UK
    Posts
    635
    Thanks
    169
    Thanked 130 Times in 128 Posts

    Re: Run 41 regression at one time

    In that case a by statement should do it. Let me just warn you that when you want your results by variable, you must always sort the data by variables first. In any case, you would have figured out the need to sort (becuase I assume the SAS log should throw an error if you don't sort beforehand).

    Code: 
    *sort data by the variable you want your results by;
    proc sort data=nameofyourdata;
    by date;
    run;
    
    *Perform OLS;
    proc reg data=nameofyourdata;
    model y = x1-x12;
    by date;
    run;
    Oh Thou Perelman! Poincare's was for you and Riemann's is for me.

  9. The Following User Says Thank You to ledzep For This Useful Post:

    whsieh (02-20-2012)

  10. #7
    Points: 482, Level: 9
    Level completed: 64%, Points required for next Level: 18

    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Run 41 regression at one time


    got it, thanks A lots!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats