Learn R Programming

fixest (version 0.5.1)

resid.fixest: Extracts residuals from a fixest object

Description

This function extracts residuals from a fitted model estimated with femlm, feols or feglm.

Usage

# S3 method for fixest
resid(object, type = c("response", "deviance", "pearson", "working"), ...)

residuals.fixest

Arguments

object

A fixest object. Obtained using the functions femlm, feols or feglm.

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.

...

Not currently used.

Value

It returns a numeric vector of the length the number of observations used for the estimation.

Format

An object of class function of length 1.

Details

The residuals returned are the difference between the dependent variable and the expected predictor.

See Also

See also the main estimation functions femlm, feols or feglm. fitted.fixest, predict.fixest, summary.fixest, vcov.fixest, fixef.fixest.

Examples

Run this code
# NOT RUN {
# simple estimation on iris data, using "Species" fixed-effects
res_poisson = femlm(Sepal.Length ~ Sepal.Width + Petal.Length +
                    Petal.Width | Species, iris)

# we plot the residuals
plot(resid(res_poisson))

# }

Run the code above in your browser using DataLab