Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

resid.fixest_multi

Extracts the residuals from a fixest_multi object


Description

Utility to extract the residuals from multiple fixest estimations. If possible, all the residuals are coerced into

Usage

## S3 method for class 'fixest_multi'
resid(
  object,
  type = c("response", "deviance", "pearson", "working"),
  na.rm = FALSE,
  ...
)

## S3 method for class 'fixest_multi'
residuals(
  object,
  type = c("response", "deviance", "pearson", "working"),
  na.rm = FALSE,
  ...
)

Arguments

object

A fixes_multi object.

type

A character scalar, either "response" (default), "deviance", "pearson", or "working". Note that the "working" corresponds to the residuals from the weighted least square and only applies to feglm models.

na.rm

Logical, default is FALSE. Should the NAs be kept? If TRUE, they are removed.

...

Not currently used.

Value

If all the models return residuals of the same length, a matrix is returned. Otherwise, a data.frame is returned.

Examples

base = iris
names(base) = c("y", "x1", "x2", "x3", "species")

# A multiple estimation
est = feols(y ~ x1 + csw0(x2, x3), base)

# We can get all the residuals at once,
# each column is a model
head(resid(est))

# We can select/order the model using fixest_multi extraction
head(resid(est[rhs = .N:1]))

fixest

Fast Fixed-Effects Estimations

v0.10.0
GPL-3
Authors
Laurent Berge [aut, cre], Sebastian Krantz [ctb], Grant McDermott [ctb] (<https://orcid.org/0000-0001-7883-8573>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.