Hi
I have to run a simple regression with a dependent and three independent variables. I need to run this regression with fixed effects i.e. "fixed effect for firms" and "fixed effect for years". The number of firms in my data is around 5000, whereas years are 12. I can get the results by using "proc glm" with "absorb" and "class" statements.
proc glm data= have;
absorb PERMNO;
class year;
model Y = X1 X2 X3 year / solution noint;
run;
However, I also require to obtain t-stat for the above regression with robust/corrected standard errors by using Newey West. Please guide me how can I combine Newey West standard errors and fixed effects in the same regression?
To apply Newey-West, the clearest path is to switch to PROC MODEL in SAS/ETS. See
I doubt that Newey-West is possible using PROC GLM.
@sld Thanks, PROC MODEL can work for me for Newey West Standard Errors but how can I apply fixed effects for firm and year in the same model?
Proc MODEL is capable of multiple regression, but it has no CLASS statement. Theoretically, you could code indicator variables for FIRM and YEAR and then use those indicator variables in the MODEL statement. But 5000 FIRMs? I have no idea whether that is possible. I would ask SAS Technical Support.
@sld Exactly, I tried to create dummy variables for year and firms but the system jammed due to a large number of firms. Can you please guide me how to ask help from SAS Technical Support, I mean is there a special forum where I should post this question? Thanks.
https://support.sas.com/en/technical-support/contact-sas.html
shows the different options.
Good luck!
@sld Thanks, I have emailed the technical support team.
Tech Support has been helpful with all of my questions in the past--hopefully you'll have the same experience. Let us know!
saw this post now, not sure if you have found the solution but the best way is to de-mean your sample. because principally, fixed effects is the same but just removing the average by the fixed effect variable.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.