DATA Step, Macro, Functions and more

limiting number of days observed for regression

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

limiting number of days observed for regression

I have a dataset that has 90 days work of history that I am doing a regression on. I'd like to also do regressions based on the last 25 days and the last 10 days of history. Does anyone know of a way to do this in SAS?


Accepted Solutions
Solution
‎10-28-2014 02:31 PM
Trusted Advisor
Posts: 1,204

Re: limiting number of days observed for regression

Try obs data set option like this.

proc reg data=have(obs=10);

   model Y=X;

run;

quit;

proc reg data=have(obs=25);

   model Y=X;

run;

quit;

View solution in original post


All Replies
Occasional Contributor
Posts: 14

Re: limiting number of days observed for regression

also worth mentioning is my data is set up with the most recent day as the last observation (90). So instead of regressing 1-90 I'd need to do 65-90 for a 25 day regression.

Solution
‎10-28-2014 02:31 PM
Trusted Advisor
Posts: 1,204

Re: limiting number of days observed for regression

Try obs data set option like this.

proc reg data=have(obs=10);

   model Y=X;

run;

quit;

proc reg data=have(obs=25);

   model Y=X;

run;

quit;

Occasional Contributor
Posts: 14

Re: limiting number of days observed for regression

Perfect! Thanks

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 187 views
  • 0 likes
  • 2 in conversation