| formula.fixest | R Documentation |
fixest fitThis function extracts the formula from a fixest estimation (obtained with femlm,
feols or feglm). If the estimation was done with fixed-effects, they are added
in the formula after a pipe (“|”). If the estimation was done with a non
linear in parameters part, then this will be added in the formula in between I().
## S3 method for class 'fixest'
formula(x, type = "full", fml.update = NULL, fml.build = NULL, ...)
## S3 method for class 'fixest_multi'
formula(x, type = "full", fml.update = NULL, fml.build = NULL, ...)
x |
An object of class |
type |
A character scalar. Default is
|
fml.update |
A formula representing the changes to be made to the original
formula. By default it is |
fml.build |
A formula or
Example, the original estimation was |
... |
Not currently used. |
The arguments type, fml.update and fml.build are exclusive: they
cannot be used at the same time.
It returns either a one-sided formula, either a two-sided formula.
Laurent Berge
See also the main estimation functions femlm, feols or feglm.
model.matrix.fixest, update.fixest, summary.fixest, vcov.fixest.
# example estimation with IVS and FEs
base = setNames(iris, c("y", "x1", "endo", "instr", "species"))
est = feols(y ~ x1 | species | endo ~ instr, base)
# the full formula
formula(est)
# idem without the IVs nor the FEs
formula(est, "full.nofixef.noiv")
# the reduced form
formula(est, "iv.reduced")
# the IV relation only
formula(est, "iv")
# the dependent variable => onse-sided formula
formula(est, "lhs")
# using update, we add x1^2 as an independent variable:
formula(est, fml.update = . ~ . + x1^2)
# using build, see the difference => the FEs and the IVs are not inherited
formula(est, fml.build = . ~ . + x1^2)
# we can use some special variables
formula(est, fml.build = . ~ .endo + .indep)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.