- formula
A regression formula, with or without fixed effects, given
either as a string (`"y ~ x | fe"`) or as a formula object
(`y ~ x | fe`).
- data
A data frame containing the variables provided in `formula` and
any clustering variables passed to `cluster`.
- weights
Optional string with the column name in `data` that contains
weights.
- family
A string indicating the family of models to be used. Defaults
to "linear" for OLS regression but supports all families
supported by `glm()`. When a non-linear family is supplied the
models are estimated with `glm()`; fixed effects are not
supported in that case and are ignored with a warning.
- link
A string specifying the link function to be used for the model.
Defaults to `NULL`, using OLS regression via `lm()` (or
`fixest::feols()` when fixed effects are supplied). For a
non-linear `family` the canonical link is used when `link` is
`NULL`. Supports all link functions supported by the family
parameter of `glm()`.
- types
A string or vector of strings specifying what types of
standard errors are desired. Defaults to "all".
The following types are supported for non-fixed effects models:
With clustering: "HC0, "HC1", "HC2", "HC3".
Without clustering: "iid" (i.e. normal standard errors),
"HC0, "HC1", "HC2", "HC3",
"HC4", "HC4m", "HC5",
"bootstrapped".
The following types are supported for fixed effects models:
With clustering: "CL_FE" (standard errors clustered by the
first fixed effect), if clusters are supplied
then the conventional clustered standard
errors from `feols()` are estimated for each
clustering specification. Two-way (and
multiway) clustering is supported; see the
`cluster` argument.
Without clustering: "HC0, "HC1", "HC2", "HC3",
"HC4", "HC4m", "HC5",
"bootstrapped".
- cluster
Variables in `data` to cluster the standard errors on. Either
a character vector, in which case each element is used for a
separate **one-way** clustering, or a list of character
vectors, in which case each element is clustered on **jointly**
(one-way when the element names a single variable, two-way or
higher when it names several). For example
`cluster = list("a", "b", c("a", "b"))` produces one-way SEs
clustered by `a`, one-way by `b`, and two-way clustered by `a`
and `b`. Multiway columns are labelled with the clustering
dimensions joined by `_BY_` (e.g. `"HC1_a_BY_b"`, or
`"CL_a_BY_b_FE"` for a fixed-effects model); the dimensions are
sorted, so the label is the same regardless of the order they
are listed in. Unknown variables are dropped with a warning.
Defaults to `NULL` (no clustering).
- clustered_only
A boolean indicating whether only standard errors with
clustering should be estimated, defaults to `FALSE`.
- fixed_effects_only
A boolean indicating whether only standard errors for
fixed effects models should be estimated, defaults to
`FALSE`.
- boot_samples
An integer or vector of integers indicating how many times
the model should be estimated with a random subset of the
data. If a vector then every combination of `boot_samples`
and `boot_sample_size` are estimated.
- boot_sample_size
An integer or vector of integers indicating how many
observations are in each random subset of the data.
If a vector then every combination of `boot_samples`
and `boot_sample_size` are estimated.
- ...
Deprecated camelCase arguments (`clusteredOnly`,
`fixedEffectsOnly`, `bootSamples`, `bootSampleSize`); use the
snake_case equivalents instead.