Description Usage Arguments Details Value Side Effects Acknowledgments References See Also Examples
Generates diagnostic plots for a regression-scale model using different types of residuals, Cook's distance and the leverages.
1 2 3 4 5 |
rsmfit, x |
a |
rsmdiag |
the object returned by a call to |
weighting |
character string; defines the weight matrix that should be used in
the calculation of the residuals and diagnostics. Possible
choices are |
which |
which plot to print. Admissible values are |
subset |
subset of data used in the original |
iden |
logical argument. If |
labels |
a vector of labels for use with |
ret |
logical argument indicating if |
... |
additional arguments such as graphical parameters. |
The diagnostics required for the plots are calculated by
rsm.diag
. These are then used to produce the plots
on the current graphics device.
A menu lists all the plots that can be produced. They may be one or all of the following:
1 2 3 4 5 6 7 8 9 10 11 12 |
In the normal scores plots, the dotted line represents the expected line if the residuals are normally distributed, i.e. it is the line with intercept 0 and slope 1.
In general, when plotting Cook's distance against the standardized leverages, there will be two dotted lines on the plot. The horizontal line is at 8/(n-2p), where n is the number of observations and p is the number of estimated parameters. Points above this line may be points with high influence on the model. The vertical line is at 2p/(n-2p) and points to the right of this line have high leverage compared to the variance of the raw residual at that point. If all points are below the horizontal line or to the left of the vertical line then the line is not shown.
Use of iden = TRUE
is encouraged for proper exploration of
these plots as a guide to how well the model fits the data and
whether certain observations have an unduly large effect on
parameter estimates.
If ret
is TRUE
then the value of rsmdiag
is returned, otherwise there is no returned value.
The current device is cleared. If iden = TRUE
, interactive
identification of points is enabled. All screens are closed, but
not cleared, on termination of the function.
This function is based on A. J. Canty's function
glm.diag.plots
contained in the package boot.
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, London.
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.
rsm.diag
, rsm.object
,
identify
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## 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)
## Not run:
rsm.diag.plots(venice.rsm, which = 3)
## End(Not run)
## or
## Not run:
plot(venice.rsm)
## End(Not run)
## menu-driven
##
rsm.diag.plots(venice.rsm, which = 5, las = 1)
## normal QQ-plot of r* residuals
## Not run:
rsm.diag.plots(venice.rsm, which = 7, iden = T, labels = paste(1931:1981))
## End(Not run)
## year 1932 highly influential
detach()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.