fixestIn vcov, the degree-of-freedom in the small sample correction correction was fixed to “nested” and couldn’t be modified, now corrected. Further, “nested” was not properly accounted for, now corrected.
In etable, fitsat = FALSE or fitsat = NA led to a bug.
r2: bug when the estimation contained only fixed effects (thanks to Luis Fonseca #27).
Now the BIC of feglm is similar to the one of glm.
Bug in the log-likelihood in the presence of weights, now corrected.
Bug in coefplot when some interacted variables were removed because of collinearity. Now corrected.
On standard-errors: how are the SEs computed in fixest and how to replicate the SEs from other software.
Exporting estimation tables: how to use efficiently etable, in particular how to customize the tables.
New arguments: group, extraline, notes, tablefoot.
group allows to eliminate variables (like drop) and adds an extra line with TRUE/FALSE if the model contained those variables.
extraline allows to add extra lines with any content.
notes allows to add notes after the table (suggestion by @bgchamps #25).
tablefoot controls whether the table footer, containing the type of standard-errors and the significance codes, should be displayed.
Renaming: yesNoFixef => yesNo.
Most default values can be set globally with the new function setFixest_etable.
dof, used to adjust the small sample corrections, is now much more complete and allows to replicate a large set of estimation results from alternative software.You can now provide custom VCOVs to summary by using the argument .vcov.
A warning is now prompted when the maximum number of iterations of the algorithm is reached (suggestion by @clukewatson #24]).
The types of standard-errors can now be set globally with the function setFixest_se (suggestion by @dlindzee #28)
New feols argument demeaned. If TRUE, then the centered variables are returned (y_demeaned and X_demeaned). (Suggestion by Linus Holtermann.)
interact gains two new arguments: drop and keep (suggestion by @SuperMayo #23).
hatvalues has been implemented for feols and feglm estimations.
the estfun from sandwich has been implemented.
residuals.fixest.etablestyle which allows to set many elements of the output table.signifCode can be equal to "letters" to display letters instead of stars.setFixest_nthreads now respects the OMP_THREAD_LIMIT environment variable.var::fe syntax with confirm = TRUE and no reference.etable when the standard-errors where NA.feglm for non-poisson, non-binomial families, are now correct (minor differences).fixef did not work when the slope was an integer, now corrected (thanks to @clerousset #20).setFixest_fml(..ctrl = ~ var1 + var2). Here the macro variable ..ctrl has been set to the value "var1 + var2".fixest estimation: e.g. data(airquality) ; setFixest_fml(..ctrl = ~ Temp + Day) ; feols(Ozone ~ Wind + ..ctrl, airquality).xpd, which expands formulas. E.g. lm(xpd(Ozone ~ Wind + ..ctrl), airquality).to_integer: user-level version of the internal algorithm transforming any kind of vector (or combination of vectors) into an integer ranging from 1 to the number of unique elements of the vector. Very fast.demean: user-level version of the demeaning algorithm used in feols.New internal algorithm to estimate OLS (applies to both feols and feglm):
It is numerically more stable.
Incomparably faster when factors are to be estimated (and not explicitly used as fixed-effects).
Collinear variables are removed on the fly.
var::fe(ref) now accept multiple references (i.e. ref can be a vector).etable, the variable names of non-Latex output can now be changed.n when applying summary to choose the number of coefficients to display.confirm has been removed from the function interact.r2 allows more flexibility in the keywords it accepts.dof gains a new argument adj which allows to make different types of common small sample corrections. Its other arguments have been renamed for clarity (fixef => fixef.K, exact => fixef.exact, cluster => cluster.adj).feols and non-poisson, non-binomial models in feglm. For all other models, z-statistics are used. This complies with the default’s R-stats behavior.residuals method has been substantially improved, now allowing different types.collinearity help pages: an example could lead to an error (due to random data generation). It has been removed.collinearity, corrected the problem of display of the intercept in some situations.cex and lwd in coefplot have been changed to 1 and 1 (instead of par(“cex”) and par(“lwd”)). Otherwise this led to the creation of Rplots.pdf in the working directory (thanks to Kurt Hornik).fixef_sizes.simplify, which provides the sizes of the fixed-effects in parentheses when there is no ambiguity.signifCode = NA.float which decides whether to embed the table into a table environment. By default it is set to TRUE if a title or label is present.keep to select the variables to keep in the table.coefstat defining what should be shown below the coefficients (standard-errors, t-stats or confidence intervals). Suggestion by @d712 #16.horiz. The coefficients can now be displayed horizontally instead of vertically.lab.fit: “simple”, the classic axis, “multi”, the labels appear across multiple lines to avoid collision, and “tilted” for tilted labels.style allows you to set styles with the function setFixest_coefplot, you can then summon the style in coefplot with this argument.coefplot (e.g. setFixest_dict(c(var1 = “a \(\\times\) b”, “&var1” = "&a%*%b")), the variable var1 will be rendered differently in etable and in coefplot).group and group.par).terms.fixest giving the terms of the estimation.donttest sections were removed from help pages.etable. In the process, some of their arguments were “lost”, this is now corrected.coefplot now accepts lists of estimations.You can now add lags and leads in any fixest estimations. You only need to provide the panel identifiers with the new argument panel.id, then you’re free to use the new functions l() for lags and f() for leads.
You can also set up a panel data set using the function panel which allows you to use the lagging functions without having to provide the argument panel.id, and which dispose of more options for setting the panel.
You can now add interactions in formulas with a new syntax: var::fe(ref)
The command var::fe(ref) interacts the variable var with each value of fe and sets ref as a reference. Note that if you don’t use the argument ref, the command var::fe is identical to var:factor(fe).
Using var::fe(ref) to write interactions opens up a special treatment of such variables in the exporting function etable and in the coefficient plotting function coefplot.
coefplotYou can plot coefficients and their associated confidence intervals with the function coefplot.
coefplot dispose of many options, whose default values can be set with the function setFixest_coefplot.
As for the function etable, you can easily rename/drop/order the coefficients.
coefplot detects when interactions have been used and offers a special display for it.
[etable] Estimations table: new function to export the results of multiple estimations. Replaces the two functions esttex and esttable (the two functions still exist but they will be deprecated in the future).
[Lagging] New functions related to lagging: l, f, panel, unpanel and [.fixest_panel.
[Utilities] A set of small utility functions has been added. They allow to extract part a coefficient table or parts of it (like the t-statistics of the standard-error) from an estimation. These functions are coeftable, ctable (an alias to coeftable), se, tstat and pvalue.
[coefplot] The functions coefplot and setFixest_coefplot.
[dof] New function to set the type of degree of freedom adjustment when computing the variance-covariance matrix. You can permanently set the type of DoF adjustment with the new function setFixest_dof().
dict=c(x1="Wind", x2="Rain"), with an estimation with the following variables ‘x1’, ‘x2’, ‘x1:x2’ will lead to the following aliases in Latex ‘Wind’, ‘Rain’ and ‘Wind \(\\times\) Rain’.yesNoFixef can be of length one, defaulting the second element to the empty string.did_estimate_yearly_effects.feglm.-[did_means] New function did_means to conveniently compare means of groups of observations (both treat/control and pre/post). Contains tools to easily export in Latex.
sym macro in Latex is dropped.This package is an effort to create a family of fast and user-friendly functions to perform estimations with multiple fixed-effects (F.E.).
Estimations with fixed-effects (or call it factor variables) is a staple in social science. Hence having a package gathering many methods with fast execution time is of prime importance. At the time of this version, this is the fastest existing method to perform F.E. estimations (often by orders of magnitude, compared to the most efficient alternative methods [both in R and Stata]). The underlying method to obtain the F.E. is based on Berge 2018, and the workhorse of the code is in c++ parallelized via OpenMP (btw thanks Rcpp for simplifying coders’ life!).
This package is the follow up of the (now deprecated) package FENmlm which performed fixed-effects estimations but for only four likelihood families. Package fixest completely supersedes FENmlm by extending the method to regular OLS and all GLM families, and adding new utility functions. Further, the design of the functions has been completely overhauled and extended towards much more user-friendliness. Massive effort has been put into providing a set of informative error messages to the user for quick debugging of her workflow (e.g. one of the functions contains over 100 different errors messages).