08-22-2014 02:28 AM
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:
model expense = sales / solution noint;
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
Thank you in advance!
08-22-2014 08:53 AM
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:
model model expense = sales|firm_code / solution noint;
This would give separate intercepts and slopes for each firm_code, but assumes common residual variance across firm_codes
Message was edited by: Steve Denham
08-22-2014 06:29 PM
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!