Description Usage Arguments Details Value Acknowledgments Note References See Also Examples

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

1 | ```
rsm.diag(rsmfit, weighting = "observed")
``` |

`rsmfit` |
an |

`weighting` |
character string; defines the weight matrix that should be used
in the calculation of the residuals and diagnostics. Possible
choices are |

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 *Unif(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).

Returns a list with the following components:

`resid` |
the response residuals on the response scale. |

`rd` |
the standardized deviance residuals from the IRLS fit. |

`rp` |
the standardized Pearson residuals from the IRLS fit. |

`rg` |
the deletion residuals from the IRLS fit. |

`rs` |
the |

`rcs` |
the probability transform residuals from the IRLS fit. |

`cook` |
Cook's distance. |

`h` |
the leverages of the observations. |

`dispersion` |
the value of the scale parameter. |

This function is based on A.J. Canty's function `glm.diag`

contained in the package boot.

Huber's least favourable distribution represents a special case.
The regression diagnostics are only meaningful if the errors
*truly* follow a Huber-type distribution. This no longer holds
if the option `family = Huber`

in `rsm`

is used to
obtain the M-estimates of the parameters in place or the maximum
likelihood estimates.

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.

`rsm.diag.plots`

, `rsm.object`

,
`summary.rsm`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
## 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
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.