Quartz | Level 8

## 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!

1 ACCEPTED SOLUTION

Accepted Solutions
Barite | Level 11

## Re: proc glm: class vs. absorb

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

3 REPLIES 3
Barite | Level 11

## Re: proc glm: class vs. absorb

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

Quartz | Level 8

## 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!

Barite | Level 11

## Re: proc glm: class vs. absorb

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

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