[.fixest_multi | R Documentation |
Subsets a fixest_multi object using different keys.
## S3 method for class 'fixest_multi'
x[i, sample, lhs, rhs, fixef, iv, I, reorder = TRUE, drop = FALSE]
x |
A |
i |
An integer vector. Represents the estimations to extract. |
sample |
An integer vector, a logical scalar, or a character vector. It represents
the |
lhs |
An integer vector, a logical scalar, or a character vector. It represents
the left-hand-sides identifiers for which the results should be extracted. Only valid when
the |
rhs |
An integer vector or a logical scalar. It represents the right-hand-sides
identifiers for which the results should be extracted. Only valid when the |
fixef |
An integer vector or a logical scalar. It represents the fixed-effects
identifiers for which the results should be extracted. Only valid when the |
iv |
An integer vector or a logical scalar. It represent the stages of the IV. Note
that the length can be greater than 2 when there are multiple endogenous regressors (the
first stage corresponding to multiple estimations). Note that the order of the stages depends
on the |
I |
An integer vector. Represents the root element to extract. |
reorder |
Logical, default is |
drop |
Logical, default is |
The order with we we use the keys matter. Every time a key sample
, lhs
, rhs
,
fixef
or iv
is used, a reordering is performed to consider the leftmost-side key
to be the new root.
Use logical keys to easily reorder. For example, say the object res
contains a
multiple estimation with multiple left-hand-sides, right-hand-sides and fixed-effects.
By default the results are ordered as follows: lhs
, fixef
, rhs
.
If you use res[lhs = FALSE]
, then the new order is: fixef
, rhs
, lhs
.
With res[rhs = TRUE, lhs = FALSE]
it becomes: rhs
, fixef
, lhs
. In both cases
you keep all estimations.
It returns a fixest_multi
object. If there is only one estimation left in the object, then
the result is simplified into a fixest
object only with drop = TRUE
.
The main fixest estimation functions: feols
, fepois
,
fenegbin
, feglm
, feNmlm
. Tools for mutliple fixest
estimations: summary.fixest_multi
, print.fixest_multi
, as.list.fixest_multi
,
sub-sub-.fixest_multi
, sub-.fixest_multi
.
# Estimation with multiple samples/LHS/RHS
aq = airquality[airquality$Month %in% 5:6, ]
est_split = feols(c(Ozone, Solar.R) ~ sw(poly(Wind, 2), poly(Temp, 2)),
aq, split = ~ Month)
# By default: sample is the root
etable(est_split)
# Let's reorder, by considering lhs the root
etable(est_split[lhs = 1:.N])
# Selecting only one LHS and RHS
etable(est_split[lhs = "Ozone", rhs = 1])
# Taking the first root (here sample = 5)
etable(est_split[I = 1])
# The first and last estimations
etable(est_split[i = c(1, .N)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.