I am trying to use stargazer
package after estimating model with felm
(from lfe
package) and getting error, maybe somebody could provide help on this. Below I provide a simple example.
library(lfe)
library(stargazer)
oldopts <- options(lfe.threads=1)
x <- rnorm(1000)
x2 <- rnorm(length(x))
id <- factor(sample(10,length(x),replace=TRUE))
firm <- factor(sample(3,length(x),replace=TRUE,prob=c(2,1.5,1)))
year <- factor(sample(10,length(x),replace=TRUE,prob=c(2,1.5,rep(1,8))))
id.eff <- rnorm(nlevels(id))
firm.eff <- rnorm(nlevels(firm))
year.eff <- rnorm(nlevels(year))
y <- x + 0.25*x2 + id.eff[id] + firm.eff[firm] +year.eff[year] + rnorm(length(x))
est <- felm(y ~ x+x2 | id + firm + year)
stargazer(est)
I get the following error:
Error in if (.global.coefficient.variables[i] %in% .global.intercept.strings) { : argument is of length zero
felm
model is in the list of supported objects (cran.r-project.org/web/packages/stargazer/stargazer.pdf). You probably should contact the maintainer:maintainer("stargazer")
. – Wolfy