How to calculate with fixed effects?
Posted: 18 April 2016 09:49 PM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2016-04-18

Let’s say I have time series data for 10 years across 5 industries. I want to be able to control for yearly effects and industry effects. Ideally, I would create 9 dummy variables for 9 of the years (not 10, to avoid dummy variable trap) and 5 industry dummy variables for the 5 industries.

However, that is a lot of dummy variables to manually create and keep track of. So, instead of creating dummy variables, I’m using fixed effects. Looking around, I found two ways to use fixed effects in class proc glm and proc surveyreg:

proc glm data table1;
class 
year industry;
model y solution;
runquit;

proc surveyreg data table1;
class 
year industry;
model y solution;
runquit

However, I have two questions / confusions:

1) Do I need to include year and industry in the model statement? If I include the year and industry in the model statement, SAS tells me that The X’X matrix has been found to be singular, essentially one or more of my independent variables are the exact same. If I do not include year and industry in the model statement, it works just fine.

2) Is proc glm or proc surveyreg a better way to use fixed effects? They both seem to give different results.

Thanks!

Profile
 
 
Posted: 19 April 2016 08:29 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Bob,

Great questions!

This page will be helpful: http://kelley.iu.edu/nstoffma/fe.html

It looks like you can do two things:
- use ‘absorb’ instead of class
- add ‘noint’ in the model with year and industry (model y= x year industry / solution noint)

Surveyreg gives robust standard errors; I’m not sure about glm. In any case, the coefficients should be identical (standard errors may differ if glm is not robust).

Hope this helps,

Joost

 

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 19 April 2016 02:38 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  2
Joined  2016-04-18
Joost Impink - 19 April 2016 08:29 AM

hi Bob,

Great questions!

This page will be helpful: http://kelley.iu.edu/nstoffma/fe.html

It looks like you can do two things:
- use ‘absorb’ instead of class
- add ‘noint’ in the model with year and industry (model y= x year industry / solution noint)

Surveyreg gives robust standard errors; I’m not sure about glm. In any case, the coefficients should be identical (standard errors may differ if glm is not robust).

Hope this helps,

Joost

Thank you!

Profile
 
 
   
 
 
‹‹ Fixed effects