Skip to contents

Extracts the meta information on all the models contained in a fixest_multi estimation.

Usage

models(x, simplify = FALSE)

Arguments

x

A fixest_multi object, obtained from a fixest estimation leading to multiple results.

simplify

Logical, default is FALSE. The default behavior is to display all the meta information, even if they are identical across models. By using simplify = TRUE, only the information with some variation is kept.

Value

It returns a data.frame whose first column (named id) is the index of the models and the other columns contain the information specific to each model (e.g. which sample, which RHS, which dependent variable, etc).

See also

multiple estimations in feols, n_models

Examples


# a multiple estimation
base = setNames(iris, c("y", "x1", "x2", "x3", "species"))
est = feols(y ~ csw(x.[, 1:3]), base, fsplit = ~species)

# All the meta information
models(est)
#>    id sample.var      sample          rhs
#> 1   1    species Full sample           x1
#> 2   2    species Full sample      x1 + x2
#> 3   3    species Full sample x1 + x2 + x3
#> 4   4    species      setosa           x1
#> 5   5    species      setosa      x1 + x2
#> 6   6    species      setosa x1 + x2 + x3
#> 7   7    species  versicolor           x1
#> 8   8    species  versicolor      x1 + x2
#> 9   9    species  versicolor x1 + x2 + x3
#> 10 10    species   virginica           x1
#> 11 11    species   virginica      x1 + x2
#> 12 12    species   virginica x1 + x2 + x3

# Illustration: Why use simplify
est_sub = est[sample = 2]
models(est_sub)
#>   id sample.var sample          rhs
#> 4  1    species setosa           x1
#> 5  2    species setosa      x1 + x2
#> 6  3    species setosa x1 + x2 + x3
models(est_sub, simplify = TRUE)
#>   id          rhs
#> 4  1           x1
#> 5  2      x1 + x2
#> 6  3 x1 + x2 + x3