BookmarkSubscribeRSS Feed
wryd078
Calcite | Level 5

Hi SAS Community,

 

I'm currently using a macro to run rolling regressions where every year the data size increases, i.e. 2009, 2009-2010, 2009-2011 etc., with the following code. 

 

ods graphics off;
ods listing close;
%macro loopOverYears;
%do i=2009 %to 2018;
ods output ParameterEstimates=Output&i;
proc sort data=import; by GIC_SECT Year;
proc glm data=import;
class GIC_SECT Year;
model logtotal = GIC_SECT Year logrev logassets logcapx gmar levg / solution;
where year<=&i;
run;
 
%if &i = 2009 %then %do;
data AllEstimates;
set output&i;
endYear=&i;
run;
%end;
%else %do;
data output&i;
set output&i;
endYear=&i;
run;
data AllEstimates;
set AllEstimates output&i;
run;
%end;
%end;
ods listing;
%mend;
%loopOverYears;
 
From here, I need to be able to use the coefficients from these regression results to predict next year's logtotal based on next year's independent variables (GIC_SECT Year logrev logassets logcapx gmar levg). For example, I would run a regression for a data subset 2009-2015 and then use these results to predict logtotal in 2016 based on the independent variables in 2016. 
 
Does anyone know how I might accomplish this? 
1 REPLY 1
sbxkoenk
SAS Super FREQ

These three articles should help you out. They give an exhaustive answer to your scoring question.

 

1.

Techniques for scoring a regression model in SAS

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 437 views
  • 0 likes
  • 2 in conversation