BookmarkSubscribeRSS Feed
Saba1
Quartz | Level 8

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?

8 REPLIES 8
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

To apply Newey-West, the clearest path is to switch to PROC MODEL in SAS/ETS. See

Usage Note 40098: Newey-West correction of standard errors for heteroscedasticity and autocorrelatio...

 

I doubt that Newey-West is possible using PROC GLM.

 

Saba1
Quartz | Level 8

@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?

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

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.

 

Saba1
Quartz | Level 8

@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.

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

https://support.sas.com/en/technical-support/contact-sas.html

 

shows the different options.

 

Good luck!

 

Saba1
Quartz | Level 8

@sld Thanks, I have emailed the technical support team.

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Tech Support has been helpful with all of my questions in the past--hopefully you'll have the same experience. Let us know!

 

somebody
Lapis Lazuli | Level 10

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. 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 8 replies
  • 2900 views
  • 1 like
  • 3 in conversation