| update.fixest | R Documentation |
fixest estimationUpdates and re-estimates a fixest model (estimated with femlm, feols or feglm).
This function updates the formulas and use previous starting values to estimate a new
fixest model. The data is obtained from the original call.
## S3 method for class 'fixest'
update(
object,
fml.update = NULL,
fml = NULL,
nframes = 1,
use_calling_env = NULL,
evaluate = TRUE,
...
)
## S3 method for class 'fixest_multi'
update(
object,
fml.update = NULL,
fml = NULL,
nframes = 1,
use_calling_env = TRUE,
evaluate = TRUE,
...
)
object |
A |
fml.update |
A formula representing the changes to be made to the original
formula. By default it is |
fml |
A formula, default is |
nframes |
(Advanced users.) Defaults to 1. Only used if the argument
|
use_calling_env |
Logical scalar, default is |
evaluate |
Logical, default is |
... |
Other arguments to be passed to the functions |
It returns a fixest object (see details in femlm, feols or feglm).
Laurent Berge
See also the main estimation functions femlm, feols or feglm.
predict.fixest, summary.fixest, vcov.fixest, fixef.fixest.
# Example using trade data
data(trade)
# main estimation
est_pois = fepois(Euros ~ log(dist_km) | Origin + Destination, trade)
# we add the variable log(Year)
est_2 = update(est_pois, . ~ . + log(Year))
# we add another fixed-effect: "Product"
est_3 = update(est_2, . ~ . | . + Product)
# we remove the fixed-effect "Origin" and the variable log(dist_km)
est_4 = update(est_3, . ~ . - log(dist_km) | . - Origin)
# Quick look at the 4 estimations
etable(est_pois, est_2, est_3, est_4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.