n_models function

Gets the dimension of fixest_multi objects

Gets the dimension of fixest_multi objects

Otabin the number of unique models of a fixest_multi object, depending on the type requested.

n_models( x, lhs = FALSE, rhs = FALSE, sample = FALSE, fixef = FALSE, iv = FALSE )

Arguments

  • x: A fixest_mutli object, obtained e.g. from feols.
  • lhs: Logical scalar, default is FALSE. If TRUE, the number of different left hand sides is returned.
  • rhs: Logical scalar, default is FALSE. If TRUE, the number of different right hand sides is returned.
  • sample: Logical scalar, default is FALSE. If TRUE, the number of different samples is returned.
  • fixef: Logical scalar, default is FALSE. If TRUE, the number of different types of fixed-effects is returned.
  • iv: Logical scalar, default is FALSE. If TRUE, the number of different IV stages is returned.

Returns

It returns an integer scalar. If no argument is provided, the total number of models is returned.

Examples

base = setNames(iris, c("y", "x1", "x2", "x3", "species")) est = feols(y ~ csw(x1, x2, x3), base, fsplit = ~species) # there are 3 different RHSs and 4 different samples models(est) # We can obtain these numbers with n_models n_models(est, rhs = TRUE) n_models(est, sample = TRUE)

See Also

Multiple estimations in feols, models