Hi all,
I've recently begun using proc glm to run fixed effects regressions. Say if I want to run a regression of variable A over independent variables B and C, while controlling for year fixed effects, google tells me there are two ways to do this:
proc glm;
class year;
model A=B C / solution noint; run;
quit;
or
proc glm;
absorb year;
model A=B C / solution noint; run;
quit;
Google also tells me that the only difference between the above two is with absorb, estimates of year will not be shown, while with class, they will be shown.
So I tried both, and I don't see individual year fixed effects estimates in either. Also, perhaps more importantly to me, the estimates in B and C are vastly different with the above two procedures. Please help! Which one should I use? And what is the reason for difference estimates on B and C? Thanks a lot!
The class statement defines which variables are to be treated as categorical variables in the model statement.
And you did not add the variable year in the model statment, after the Class statment.
So try:
proc glm;
class year;
model A=B C year/ solution noint; run;
quit;
Then you will get the individual year fixed effects estimates. And you should get no difference estimates on B and C for the two procedures
The class statement defines which variables are to be treated as categorical variables in the model statement.
And you did not add the variable year in the model statment, after the Class statment.
So try:
proc glm;
class year;
model A=B C year/ solution noint; run;
quit;
Then you will get the individual year fixed effects estimates. And you should get no difference estimates on B and C for the two procedures
Hi Mohamed,
Thanks a lot for the answer! I added year in and saw the individual estimates. Also when I included year as an independent variable, the estimates are not different with class or absorb. Thanks again!
Also in general i found this paper to be helpful "Fixed Effects Regression Methods In SAS®"
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.