An R-package for fitting glm's with high-dimensional k-way fixed effects.
Provides a routine to partial out factors with many levels during the optimization of the log-likelihood function of the corresponding generalized linear model (glm). The package is based on the algorithm described in Stammann (2018) and is restricted to glm's that are based on maximum likelihood estimation and non-linear. It also offers an efficient algorithm to recover estimates of the fixed effects in a post-estimation routine and includes robust and multi-way clustered standard errors. Further the package provides analytical bias corrections for binary choice models (logit and probit) derived by Fernandez-Val and Weidner (2016) and Hinz, Stammann, and Wanner (2020).
If you have any suggestions for improvements or questions, feel free to contact me.
The package is also available on CRAN.
Changes:
vcov.APEs()
generic to extract the covariance matrix after getAPEs()
.getAPEs()
after biasCorr()
, do not require an offset algorithm anymore.getAPEs()
has been changed. Now the estimated covariance consists of the delta method part only, i.e. correction factor = 0.biasCorr()
now also supports one-way fixed effects models.feglm()
and feglm.nb()
do not return a matrix of scores anymore. Instead they, optionally, return the centered regressor matrix. The corresponding option in feglmControl()
is 'keep.mx'. Default is TRUE.feglm()
.feglmControl()
has been lowered to better handle fitting problems that are not well-behaved.feglm()
and feglm.nb()
.Changes:
feglm.nb()
has been adjusted to better match that of glm.nb()
.feglm.nb()
now additionally returns 'iter.outer' and 'conv.iter' based on iterations of the outer loop. Previously 'iter' and 'conv' were overwritten.feglmFit()
and feglmOffset()
is now similar to glm.fit2()
.getAPEs()
.Changes:
biasCorr()
and getAPEs()
. This option allows to choose between the two-way bias correction suggested by Fernandez-Val and Weidner (2016) and the bias corrections for network data suggested by Hinz, Stammann, and Wanner (2020). Currently both corrections are restricted to probit and logit models.getAPEs()
to impose simplifying assumptions when estimating the covariance matrix.feglm()
now permits to expand functions with poly()
and bs()
(#9 @tcovert).feglm()
now uses an acceleration scheme suggested by Correia, Guimaraes, and Zylkin (2019) that uses smarter starting values for centerVariables()
.getAPEs()
related to the estimation of the covariance.Changes:
setDT()
instead of as.data.table()
to avoid unnecessary copies (suggested in #6 @zauster).feglm.nb()
now returns 'iter' and 'conv' based on iterations of the outer loop.feglm()
that prevented to use I()
for the dependent variable.getAPEs()
related to the covariance.print.summary.feglm()
now ends with a line break (#6 @zauster).feglmFit()
now correctly sets 'conv' if the algorithm does not converge (#5 @zauster).Changes:
feglm.nb()
for negative binomial models.biasCorr()
for analytical bias-corrections (currently restricted to logit and probit models with two-way error component).getAPEs()
to estimate average partial effects and the corresponding standard errors (currently restricted to logit and probit models with two-way error component).getFEs()
now returns a list of named vectors. Each vector refers to one fixed effects category.glm()
.ATTENTION: Syntax changed slightly. Have a look at the vignettes or help files.
Changes:
glm()
.Changes:
family
.Changes:
factor()
should now work as intended.Changes:
"probit"
to argument family
.getFEs()
returns a named vector.Bugfix: