BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JOLSAS
Quartz | Level 8

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!

1 ACCEPTED SOLUTION

Accepted Solutions
mohamed_zaki
Barite | Level 11

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

View solution in original post

3 REPLIES 3
mohamed_zaki
Barite | Level 11

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

JOLSAS
Quartz | Level 8

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!

mohamed_zaki
Barite | Level 11

Also in general i found this paper to be helpful "Fixed Effects Regression Methods In SAS®"

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 7272 views
  • 2 likes
  • 2 in conversation