residuals.rsm: Compute Residuals for Regression-Scale Models

Description Usage Arguments Details Value Note References See Also Examples

Description

Computes one of the six types of residuals available for regression-scale models.

Usage

1
2
3
4
## S3 method for class 'rsm'
residuals(object, type = c("deviance", "pearson", 
                           "response", "r.star", "prob", "deletion"),
          weighting = "observed", ...)

Arguments

object

an object inheriting from class rsm representing a fitted regression-scale model.

type

character string; defines the type of residuals, with choices "deviance", "pearson", "response", "r.star", "prob" or "deletion"; the first is the default.

weighting

character string; defines the weight matrix that should be used in the calculation of the residuals and diagnostics. Possible choices are "observed", "score", "deviance" and "max"; see Jorgensen (1984) for their definition. The default is "observed".

...

absorbs any additional argument.

Details

This is a method for the function residuals() for objects inheriting from class rsm. As several types of residuals are available for rsm objects, there is an additional optional argument type. The "deviance", "pearson", "r.star", "prob" and "deletion" residuals are derived from the final IRLS fit. The "response" residuals are standardized residuals on the scale of the response, the "prob" residuals are on the Unif(0,1) scale, whereas the remaining ones follow approximately the standard normal distribution.

The default weighting scheme used is "observed". The weights used are the values stored in the q2 component of the rsm object. Some of the IRLS weights returned by rsm may be negative if the error distribution is Student's t or user-defined. In order to avoid missing values in the residuals, the default weighting scheme used is then "score" unless otherwise specified. The "score" weights are also used by default if Huber's least favourable error distribution is used.

More details, in particular of the use of these residuals, are given in Brazzale (2000, Section 6.3.1).

Value

A numeric vector of residuals. See Davison and Snell (1991) for detailed definitions of each type of residual.

Note

The summary method for rsm objects produces response residuals. The residuals component of a rsm object contains the response residuals.

References

Brazzale, A. R. (2000) Practical Small-Sample Parametric Inference. Ph.D. Thesis N. 2230, Department of Mathematics, Swiss Federal Institute of Technology Lausanne.

Davison, A. C. and Snell, E. J. (1991) Residuals and diagnostics. In Statistical Theory and Modelling: In Honour of Sir David Cox (eds. D.V. Hinkley, N. Reid, and E.J. Snell), 83–106. London: Chapman \& Hall.

Davison, A. C. and Tsai, C.-L. (1992) Regression model diagnostics. Int. Stat. Rev., 60, 337–353.

Jorgensen, B. (1984). The delta algorithm and GLIM. Int. Stat. Rev., 52, 283–300.

See Also

rsm.object, residuals

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Sea Level Data
data(venice)
attach(venice)
Year <- 1:51/51
c11 <- cos(2*pi*1:51/11) ; s11 <- sin(2*pi*1:51/11)
c19 <- cos(2*pi*1:51/18.62) ; s19 <- sin(2*pi*1:51/18.62)
venice.rsm <- rsm(sea ~ Year + I(Year^2) + c11 + s11 + c19 + s19, 
                  family = extreme)
##
residuals(venice.rsm)
## deviance residuals with observed weights
residuals(venice.rsm, type = "r.star", weighting = "score")
## r* residuals with score weights
detach()

hoa documentation built on May 2, 2019, 8:56 a.m.