coef.fixest_multi | R Documentation |
Utility to extract the coefficients of multiple estimations and rearrange them into a matrix.
## S3 method for class 'fixest_multi'
coef(
object,
keep,
drop,
order,
collin = FALSE,
long = FALSE,
na.rm = TRUE,
...
)
## S3 method for class 'fixest_multi'
coefficients(
object,
keep,
drop,
order,
collin = FALSE,
long = FALSE,
na.rm = TRUE,
...
)
object |
A |
keep |
Character vector. This element is used to display only a subset of variables. This
should be a vector of regular expressions (see |
drop |
Character vector. This element is used if some variables are not to be displayed.
This should be a vector of regular expressions (see |
order |
Character vector. This element is used if the user wants the variables to be
ordered in a certain way. This should be a vector of regular expressions (see |
collin |
Logical, default is |
long |
Logical, default is |
na.rm |
Logical, default is |
... |
Not currently used. |
base = iris
names(base) = c("y", "x1", "x2", "x3", "species")
# A multiple estimation
est = feols(y ~ x1 + csw0(x2, x3), base)
# Getting all the coefficients at once,
# each row is a model
coef(est)
# Example of keep/drop/order
coef(est, keep = "Int|x1", order = "x1")
# To change the order of the model, use fixest_multi
# extraction tools:
coef(est[rhs = .N:1])
# collin + long + na.rm
base$x1_bis = base$x1 # => collinear
est = feols(y ~ x1_bis + csw0(x1, x2, x3), base, split = ~species)
# does not display x1 since it is always collinear
coef(est)
# now it does
coef(est, collin = TRUE)
# long
coef(est, long = TRUE)
# long but balanced (with NAs then)
coef(est, long = TRUE, na.rm = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.