Last chance! 50% off unlimited learning
Sale ends in
fixest
objectThis function extracts residuals from a fitted model estimated with femlm
, feols
or feglm
.
# S3 method for fixest
resid(
object,
type = c("response", "deviance", "pearson", "working"),
na.rm = TRUE,
...
)residuals.fixest
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.
Logical, default is TRUE
. Whether to remove the observations with NAs from the original data set. If FALSE
, then the vector returned is always of the same length as the original data set.
Not currently used.
It returns a numeric vector of the length the number of observations used for the estimation (if na.rm = TRUE
) or of the length of the original data set (if na.rm = FALSE
).
An object of class function
of length 1.
See also the main estimation functions femlm
, feols
or feglm
. fitted.fixest
, predict.fixest
, summary.fixest
, vcov.fixest
, fixef.fixest
.
# 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