Help using Base SAS procedures

Fixed effect regressions

Reply
New Contributor
Posts: 3

Fixed effect regressions

Hi all,

I want to run a regression between annual expense and sales, including a fixed effect for each firm (firm_code).

I came across the codes:

proc glm;

absorb firm_code;

model expense = sales / solution noint;

run;

quit;

However, I am using a panel data including 4 years of observations for each firm. This means for each firm (firm_code) there will be four observations of expense and sales.

As a result, I only need to create on dummy variable for each firm, I am not sure whether the command "absorb" does that, or does it create a dummy variable for every line of observation for firm?

If there is any better ways of running fixed effects regression, please tell me Smiley Happy

Thank you in advance!

Respected Advisor
Posts: 2,655

Re: Fixed effect regressions

Actually, you don't have to create a dummy variable for each firm, just be certain that the dataset is sorted by firm_code.  GLM will automatically nest the observations within firm_code, and perform the regression.  And provided you don't need predicted values or regression diagnostics, you get all this with a marked reduction in overhead computational resources.

Now if you want a regression for EACH firm_code (sort of implied in the first line of your post), either a BY statement or something like:

proc glm;

class firm_code;

model model expense = sales|firm_code / solution noint;

quit;

This would give separate intercepts and slopes for each firm_code, but assumes common residual variance across firm_codes

Steve Denham

Message was edited by: Steve Denham

New Contributor
Posts: 3

Re: Fixed effect regressions

Hi Steve,

Sorry for the misunderstanding. I have a panel of annual data for different firms over several years of time. I just need to run one regression for the entire panel. However, I do need to control for firm fixed effect for each individual firm (presumably by adding a dummy variable for each firm - e.g. dummy A equals to 1 for firm A 2010, 2011, and 2012).

Thank you for your help!

Respected Advisor
Posts: 2,655

Re: Fixed effect regressions

Then ABSORB looks like your best tool to accomplish that.

Steve Denham

Ask a Question
Discussion stats
  • 3 replies
  • 3344 views
  • 0 likes
  • 2 in conversation