Fama MacBeth's Standard R Errors

Does anyone know if there is a package that will run Fama-MacBeth regressions in R and calculate standard errors? I know the package sandwichand its ability to evaluate Newey-West standard errors and also provide functions for clustering. However, I did not see anything regarding Fama-MacBeth.

+5
source share
1 answer

The package plmcan evaluate Fama-MacBeth and SE regression.

require(foreign)
require(plm)
require(lmtest)
test <- read.dta("http://www.kellogg.northwestern.edu/faculty/petersen/htm/papers/se/test_data.dta")
fpmg <- pmg(y~x, test, index=c("year","firmid")) ##Fama-MacBeth

> ##Fama-MacBeth
> coeftest(fpmg)

t test of coefficients:

            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 0.031278   0.023356  1.3392   0.1806    
x           1.035586   0.033342 31.0599   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

However, note that this method only works if your data can be bound to pdata.frame. (This will happen if you have one "duplicate couples (time-id)".)

For more details see:

+11

All Articles