Residuals for a VGLM fit
Residuals for a vector generalized linear model (VGLM) object.
residualsvglm(object, type = c("working", "pearson", "response", "deviance", "ldot", "stdres"), matrix.arg = TRUE)
object |
Object of class |
type |
The value of this argument can be abbreviated.
The type of residuals to be returned.
The default is the first one: working residuals corresponding to
the IRLS algorithm. These should be defined for all models.
They are sometimes be added to VGAM plots of estimated
component functions (see Pearson residuals for GLMs, when squared and summed over the data set, total to the Pearson chi-squared statistic. For VGLMs, Pearson residuals involve the working weight matrices and the score vectors. Under certain limiting conditions, Pearson residuals have 0 means and identity matrix as the variance-covariance matrix. Response residuals are simply the difference between the observed values and the fitted values. Both have to be of the same dimension, hence not all families have response residuals defined. Deviance residuals are only defined for models with
a deviance function. They tend to GLMs mainly.
This function returns a The choice Standardized residuals are currently
only defined for 2 types of models:
(i) GLMs
( |
matrix.arg |
Logical, which applies when if the pre-processed answer is a vector
or a 1-column matrix.
If |
This function returns various kinds of residuals, sometimes depending on the specific type of model having been fitted. Section 3.7 of Yee (2015) gives some details on several types of residuals defined for the VGLM class.
Standardized residuals for GLMs are described in
Section 4.5.6 of Agresti (2013) as the ratio of
the raw (response) residuals divided by their standard error.
They involve the generalized hat matrix evaluated at the final
IRLS iteration.
When applied to the LM,
standardized residuals for GLMs simplify to
rstandard
.
For GLMs they are basically
the Pearson residual divided by the square root of 1 minus the
leverage.
If that residual type is undefined or inappropriate then
NULL
is returned, otherwise a matrix or
vector of residuals is returned.
This function may change in the future, especially those whose definitions may change.
Agresti, A. (2007). An Introduction to Categorical Data Analysis, 2nd ed., New York: John Wiley & Sons. Page 38.
Agresti, A. (2013). Categorical Data Analysis, 3rd ed., New York: John Wiley & Sons.
Agresti, A. (2018). An Introduction to Categorical Data Analysis, 3rd ed., New York: John Wiley & Sons.
resid
,
vglm
,
chisq.test
,
hatvalues
.
pneumo <- transform(pneumo, let = log(exposure.time)) fit <- vglm(cbind(normal, mild, severe) ~ let, propodds, data = pneumo) resid(fit) # Same as having type = "working" (the default) resid(fit, type = "response") resid(fit, type = "pearson") resid(fit, type = "stdres") # Test for independence
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.