Created
January 20, 2015 16:56
-
-
Save joosti/b7bed565c81b87e288fb to your computer and use it in GitHub Desktop.
SAS fixed effects regression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* requires sorting */ | |
proc sort data = myData; by gvkey;run; | |
/* glm */ | |
proc glm data = myData; | |
absorb gvkey; | |
ods output ParameterEstimates = work.params | |
FitStatistics = work.fit | |
NObs = work.obs; | |
model depvar = indep1 indep2 / solution ; | |
quit; | |
/* similar with fixed effects estimates (slower) */ | |
proc glm data = myData; | |
class gvkey; /* instead of absorb */ | |
ods output ParameterEstimates = work.params | |
FitStatistics = work.fit | |
NObs = work.obs; | |
/* adding gvkey gives coefficient for each gvkey*/ | |
model depvar = indep1 indep2 gvkey / solution ; | |
quit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment