I'm trying to tidy the results of my fixed effects linear regression model. Here's the FELM:
model_fit <-
felm(
dependent_variable ~
independent_variable1 +
independent_variable2 +
independent_variable3 +
independent_variable4 +
|as.factor(year)+
as.factor(month),
data = df
)
Here's the code that I'm using to tidy those results and the error message:
model_results <- tidy(model_fit, conf.int = TRUE, conf.level = 0.95, fe=TRUE)
Error: No tidy method for objects of class felm
I've already updated RStudio, as well as the lfe, broom, and tidytext packages. It is my understanding that the tidy function should tidy felm objects, and the tidy.felm function no longer exists.
How can I use the tidy function for felm objects? And, if I am unable to use that function, what other function can I use to tidy my FELM?
To fix the issue:
broom
library when using the tidy()
functionSo, for example:
library(lfe)
mod <- felm(y ~ x1 +x2 | factor(id) | 0 | id, data)
broom::tidy(mod)