Learn R Programming

hoa (version 2.1.2)

rsm.diag: Diagnostics for Regression-Scale Models

Description

Calculates different types of residuals, Cook's distance and the leverages for a regression-scale model.

Usage

rsm.diag(rsmfit, weighting = "observed")

Arguments

rsmfit
an rsm object, i.e. the result of a call to rsm.
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

Value

  • Returns a list with the following components:
  • residthe response residuals on the response scale.
  • rdthe standardized deviance residuals from the IRLS fit.
  • rpthe standardized Pearson residuals from the IRLS fit.
  • rgthe deletion residuals from the IRLS fit.
  • rsthe $r^*$ residuals from the IRLS fit.
  • rcsthe probability transform residuals from the IRLS fit.
  • cookCook's distance.
  • hthe leverages of the observations.
  • dispersionthe value of the scale parameter.

Acknowledgments

This function is based on A.J. Canty's function glm.diag contained in the package boot.

Details

If the weighting scheme is "observed", the weights used are the values stored in the q2 component of the rsm object rsmfit. Otherwise, they are calculated by rsm.diag. 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 and regression diagnostics, the default weighting scheme used in rsm.diag switches automatically from "observed" to "score" unless otherwise specified. The "score" weights are also used by default if Huber's least favourable error distribution is used.

There are three types of residuals. The response residuals are taken on the response scale, whereas the probability transform residuals are on the $U(0,1)$ scale. The remaining ones follow approximately the standard normal distribution.

More details and in particular the definitions of the above residuals and diagnostics can be found in Brazzale (2000, Section 6.3.1).

References

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

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

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.

See Also

rsm.diag.plots, rsm.object, summary.rsm

Examples

Run this code
## 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)
venice.diag <- rsm.diag(venice.rsm)
## observed weights
detach()

## Darwin's Data on Growth Rates of Plants
data(darwin)
darwin.rsm <- rsm(cross-self ~ pot - 1, family = Huber, data = darwin)
darwin.diag <- rsm.diag(darwin.rsm)
## score weights

Run the code above in your browser using DataLab