I estimate a fixed effects model in R using the lm()
function. The fixed effects are included as factor(FE)
. Furthermore, I include district specific time trends which are included in the model as factor(distr):trend
. In total, this results in about 250 coefficients estimated. Since I am only interested in around 10 coefficients, I would like to remove the rest of the model object. Specifically, I would like to remove everything of these additional coefficients of the object. For further understanding, the current workflow is:
lm()
- everything works wellcoeftest()
with vcvovHAC
- computation takes forever for so many parametersstargazer()
and suppress all the not needed variables from the table - works wellAs you can see, the problem occurs when computing the standard errors of the parameters.
To address several possibly upcoming hints/questions:
I already removed the coefficients of the model using model$coefficients
. Then, when using summary(model)
the standard errors of the omitted coefficients are still shown and the coefficients are displayed as NA
. Then, the problem happens again with coeftest()
since the many coefficients are still present.
So, I would like to remove these coefficients from the model object entirely, in order to continue working with the object!
I am very happy for any hints on a possible solution!
After many hours of searching to solve the problem, I came to the conclusion that no feasible solution exists. I decided to use the fixest
package and its corresponding etable()
function and am very happy now. Can only recommend to use this package!