Programming the statistical procedures from SAS

proc glm: class vs. absorb

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

proc glm: class vs. absorb

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!


Accepted Solutions
Solution
‎12-13-2015 09:28 PM
Super Contributor
Posts: 490

Re: proc glm: class vs. absorb

[ Edited ]

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


All Replies
Solution
‎12-13-2015 09:28 PM
Super Contributor
Posts: 490

Re: proc glm: class vs. absorb

[ Edited ]

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

Contributor
Posts: 45

Re: proc glm: class vs. absorb

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!

Super Contributor
Posts: 490

Re: proc glm: class vs. absorb

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

☑ This topic is SOLVED.

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

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