Extract Model Residuals
Value
A numeric vector of residuals aligned to the original data frame.
Observations dropped during estimation (due to NAs or subset)
return NA.
Details
"response" residuals are the raw residuals: observed minus fitted values.
"pearson" residuals are standardized by the model-implied standard deviation:
\((y - \hat{y}) / \sqrt{\text{Var}(y)}\).
For Poisson models they use \(\sqrt{\hat{\mu}}\), for binary models
\(\sqrt{\hat{p}(1-\hat{p})}\), and for other models the appropriate
variance from predict(object, type = "var") or type = "var_y".
