|
||||
%FELM SAS Macro: FIXED EFFECTS LINEAR MODELSSAS users have been repeatedly bumping on the limitations of SAS’s most basic econometric procedures. PROC GLM is great for absorbing a single fixed effect but is unable to cluster standard errors and to instrument endogenous covariates. PROC SYSLIN is great for two-stage least square regressions but is unable to cluster the standard errors or to absorb high dimensionality fixed effects. PROC SURVEYREG is great for clustering (one way) standard errors but is unable to absorb high dimensionality fixed effects or to instrument endogenous covariates. For those who use SAS, which still has some advantages for handling large datasets, I’ve been writing the following %FELM (FIXED EFFECTS LINEAR MODELS) which combines absorbing multiway fixed effects, 3-way clustering and 2SLS instrumental variables regressions. Download: http://olivier.godechot.free.fr/hopfichiers/felm.sas
This macro is inspired by Simen Gaure’s excellent felm function in the lfe package (https://www.rdocumentation.org/packages/lfe/versions/2.8-3/topics/felm) and Sergio Correia’s excellent reghdfe (http://scorreia.com/software/reghdfe/). I’ve also reused previous %ClusteredTSLS macro writtent by Tanguy Brachet which clusters standard errors of an IV regression (https://www.researchgate.net/publication/303288577_Clustered_IV) and %REG2DSE Macro from Mark Ma which offers two-way clustering of an OLS simple regression (https://sites.google.com/site/markshuaima/home/two-way-clustered-standard-errors-and-sas-code) DESCRIPTION We follow here Cameron et al. (2011) and use the following formula for estimating V[B] the variance-covariance matrix of the parameters B for two-way clustering : Cf. Cameron, A.C., J.B. Gelbach and D.L. Miller (2011) "Robust inference with multiway clustering", Journal of Business & Economic Statistics 29(2):238--249. SYNTAX %felm(data=, dependent=, var=, fe=, class=, format=, cluster=, endogenous=, instruments=, weight=, multi=, threshold=0.000000001, maxiter=1000, nestedness=YES, deldata=YES); ARGUMENTS
REMARKS :
EXAMPLES *Two-way fixed effects and 2-way clustering; %felm(data=a, dependent=lwage, var=profit senoirity, fe=firm individual, cluster=firm individual); *Instrumental variable, one-way fixed effect and two-way clustering; %felm(data=a, dependent=lwage, var=age, endogenous=education, instruments=month_birth, fe=town, cluster=town year);
Download: http://olivier.godechot.free.fr/hopfichiers/felm.sas
|
English |
Français
News
![]() OgO: plus ici|more here [Work in progress] Godechot, Olivier and Ulysse Lojkine. Intensification through outsourcing ...: plus ici|more here [Presentations] 2025 Godechot, Olivier. 2025. “Economic separatism: Causes and consequences of the increase in top earner segregation”, Colloquium Series, Department ...: plus ici|more here [Peer-reviewed articles] Godechot, Olivier, Mirna Safi, and Matthew Soener. 2025. “Organisational Intersectionality: Do Gender and Migration Status Inequalities Reinforce or Offset ...: plus ici|more here [Books] Palier, Bruno et al.. 2023. Que sait-on du travail?, [What do we know about work?], Presses de Sciences ...: plus ici|more here [Peer-reviewed articles] Godechot, Olivier, Donald Tomaskovic-Devey, István Boza, Lasse Folke Henriksen, Are Skeie Hermansen, Feng Hou, Jiwook Jung, Naomi Kodama, ...: plus ici|more here [Working papers] Neumann, Nils, Olivier Godechot, Lasse Folke Henriksen, Are Skeie Hermansen, Feng Hou, Naomi Kodama, Zoltán Lippényi, Silvia Maja Melzer, ...: plus ici|more here [Home] Work in progress: plus ici|more here [Publications] Publications moved, , Follow the link : http://olivier.godechot.free.fr/hoprubrique.php?id_rub=125: plus ici|more here |
|||
HOP |