Skip to contents

Estimation

Methods to perform fixed-effects estimations

feols() feols.fit()
Fixed-effects OLS estimation
feglm() feglm.fit() fepois()
Fixed-effects GLM estimations
femlm() fenegbin()
Fixed-effects maximum likelihood models
feNmlm()
Fixed effects nonlinear maximum likelihood models

Handling results, multiple

Visualize results in tables or graphs

esttable() esttex() etable() setFixest_etable() getFixest_etable() print(<etable_tex>) print(<etable_df>) log_etable()
Estimations table (export the results of multiples estimations to a DF or to Latex)
coefplot() iplot()
Plots confidence intervals and point estimates
style.df()
Style of data.frames created by etable
style.tex()
Style definitions for Latex tables
extralines_register()
Register extralines macros to be used in etable

Handling results, single

Extracts values from single estimations

summary(<fixest>) summary(<fixest_list>)
Summary of a fixest object. Computes different types of standard errors.
obs()
Extracts the observations used for the estimation
fixest_data()
Retrieves the data set used for a fixest estimation
coeftable() se() pvalue() tstat()
Extracts the coefficients table from an estimation
coeftable(<default>) se(<default>) tstat(<default>) pvalue(<default>) se(<matrix>)
Extracts the coefficients table from an estimation
coeftable(<fixest>) se(<fixest>) tstat(<fixest>) pvalue(<fixest>)
Obtain various statistics from an estimation
coef(<fixest>) coefficients(<fixest>)
Extracts the coefficients from a fixest estimation
confint(<fixest>)
Confidence interval for parameters estimated with fixest
print(<fixest>) setFixest_print() getFixest_print()
A print facility for fixest objects.

Difference-in-difference tools

Various tools to perform DiD estimations

sunab() sunab_att()
Sun and Abraham interactions
aggregate(<fixest>)
Aggregates the values of DiD coefficients a la Sun and Abraham
i()
Create, or interact variables with, factors

Standard-errors

Computing the Standard-errors

vcov(<fixest>)
Computes the variance/covariance of a fixest object
summary(<fixest>) summary(<fixest_list>)
Summary of a fixest object. Computes different types of standard errors.
ssc() dof() setFixest_ssc() getFixest_ssc()
Governs the small sample correction in fixest VCOVs
vcov_cluster()
Clustered VCOV
vcov_conley() conley()
Conley VCOV
vcov_DK() vcov_NW() NW() newey_west() DK() driscoll_kraay()
HAC VCOVs

Multiple estimations

Perform, and handle, multiple estimations

sw() csw() sw0() csw0() mvsw()
Stepwise estimation tools
as.list(<fixest_multi>)
Transforms a fixest_multi object into a list
coef(<fixest_multi>) coefficients(<fixest_multi>)
Extracts the coefficients of fixest_multi objects
coeftable(<fixest_multi>) se(<fixest_multi>) tstat(<fixest_multi>) pvalue(<fixest_multi>)
Extracts the coefficients tables from fixest_multi estimations
confint(<fixest_multi>)
Confidence intervals for fixest_multi objects
print(<fixest_multi>)
Print method for fixest_multi objects
resid(<fixest_multi>) residuals(<fixest_multi>)
Extracts the residuals from a fixest_multi object
`[`(<fixest_multi>)
Subsets a fixest_multi object
`[[`(<fixest_multi>)
Extracts one element from a fixest_multi object
summary(<fixest_multi>)
Summary for fixest_multi objects
update(<fixest>) update(<fixest_multi>)
Updates a fixest estimation
models()
Extracts the models tree from a fixest_multi object
n_models()
Gets the dimension of fixest_multi objects

Methods from the stats package

Various methods from the stats package

model.matrix(<fixest>)
Design matrix of a fixest object
predict(<fixest>)
Predict method for fixest fits
fitted(<fixest>) fitted.values(<fixest>)
Extracts fitted values from a fixest fit
hatvalues(<fixest>)
Hat values for fixest objects
update(<fixest>) update(<fixest_multi>)
Updates a fixest estimation
resid(<fixest>) residuals(<fixest>)
Extracts residuals from a fixest object
sigma(<fixest>)
Residual standard deviation of fixest estimations
weights(<fixest>)
Extracts the weights from a fixest object
formula(<fixest>)
Extract the formula of a fixest fit
terms(<fixest>)
Extract the terms
df.residual(<fixest>)
Residual degrees-of-freedom for fixest objects

Formula tools

Tools to manipulate formulas

xpd()
Expands formula macros
setFixest_fml() getFixest_fml()
Sets/gets formula macros

Utility tools

User-level versions of internal tools

demean()
Centers a set of variables around a set of factors
demeaning_algo()
Controls the parameters of the demeaning procedure
to_integer()
Fast transform of any type of vector(s) into an integer vector
bin()
Bins the values of a variable (typically a factor)
ref()
Refactors a variable

Panel data tools

Set of tools for panel data

panel()
Constructs a fixest panel data base
unpanel()
Dissolves a fixest panel
lag(<formula>) lag_fml()
Lags a variable using a formula
f() d() l()
Lags a variable in a fixest estimation
`[`(<fixest_panel>)
Method to subselect from a fixest_panel

Handling the fixed-effects

Tools to extract and manipulate the fixed-effects

fixef(<fixest>)
Extract the Fixed-Effects from a fixest estimation.
plot(<fixest.fixef>)
Displaying the most notable fixed-effects
summary(<fixest.fixef>)
Summary method for fixed-effects coefficients

Fit statistics

Methods to extract fit statistics from estimations

fitstat()
Computes fit statistics of fixest objects
fitstat_register()
Register custom fit statistics
degrees_freedom() degrees_freedom_iid()
Gets the degrees of freedom of a fixest estimation
r2()
R2s of fixest models
AIC(<fixest>)
Aikake's an information criterion
BIC(<fixest>)
Bayesian information criterion
logLik(<fixest>)
Extracts the log-likelihood
deviance(<fixest>)
Extracts the deviance of a fixest estimation
nobs(<fixest>)
Extracts the number of observations form a fixest object
wald()
Wald test of nullity of coefficients
print(<fixest_fitstat>)
Print method for fit statistics of fixest estimations

Default values

The default arguments of many fixest functions can be set at will

esttable() esttex() etable() setFixest_etable() getFixest_etable() print(<etable_tex>) print(<etable_df>) log_etable()
Estimations table (export the results of multiples estimations to a DF or to Latex)
print(<fixest>) setFixest_print() getFixest_print()
A print facility for fixest objects.
setFixest_coefplot() getFixest_coefplot()
Sets the defaults of coefplot
setFixest_dict() getFixest_dict()
Sets/gets the dictionary relabeling the variables
setFixest_estimation() getFixest_estimation()
Default arguments for fixest estimations
setFixest_fml() getFixest_fml()
Sets/gets formula macros
setFixest_multi() getFixest_multi()
Sets properties of fixest_multi objects
setFixest_notes() getFixest_notes()
Sets/gets whether to display notes in fixest estimation functions
setFixest_nthreads() getFixest_nthreads()
Sets/gets the number of threads to use in fixest functions
setFixest_vcov() getFixest_vcov()
Sets the default type of standard errors to be used
ssc() dof() setFixest_ssc() getFixest_ssc()
Governs the small sample correction in fixest VCOVs

Data tools

Small functions related to data manipulation

fdim()
Formatted dimension
sample_df()
Randomly draws observations from a data set
n_unik() print(<vec_n_unik>) print(<list_n_unik>)
Prints the number of unique elements in a data set
osize() print(<osize>)
Formatted object size

Other methods and functions

Other methods and functions that didn’t fit the previous sections

est_env()
Estimates a fixest estimation from a fixest environment
as.dict()
Transforms a character string into a dictionary
dsb()
Simple and powerful string manipulation with the dot square bracket operator
check_conv_feols() summary(<fixest_check_conv>)
Check the fixed-effects convergence of a feols estimation
did_means()
Treated and control sample descriptives
fixest_startup_msg()
Permanently removes the fixest package startup message
bread(<fixest>)
Extracts the bread matrix from fixest objects
collinearity()
Collinearity diagnostics for fixest objects
estfun(<fixest>)
Extracts the scores from a fixest estimation
rep(<fixest>) rep(<fixest_list>) .l()
Replicates fixest objects
emmeans_support
Support for emmeans package

Data sets

Data sets used in the examples

base_did
Sample data for difference in difference
trade
Trade data sample
base_stagg
Sample data for staggered difference in difference