Description Usage Arguments Value Note Examples
Standard diagnostic plots.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
x |
A regression model with class |
y |
Not used. Present for compatibility with
generic |
... |
Additional arguments, which can be
passed to the plotting functions. See:
|
toPdf |
|
file |
Filename if writing to |
palette |
Palette of colors to use as the
'fill'/ 'background' colors for the plots.
|
usePalette |
Use the colorscheme in palette above.
|
bg |
The 'fill' or background color(s) to use, if
|
col |
The 'edge' or 'foreground' color used
to outline points in the plot.
|
alpha |
Transparency for colors above.
|
cex |
Character expansion.
|
pch |
Plotting character.
|
cex.main |
Character expansion for the plot title and the labels for the axes. |
inches |
Width of circles for the bubble plot. See
|
identify |
If |
devNew |
If |
There is one point per observation.
The following show probability P[i] on the x-axis:
P[i] vs. h[i] |
Probability vs. leverage. |
P[i] vs. dChisq[i] |
Probability vs. the change in the standardized Pearsons chi-squared with observation i excluded. |
P[i] vs. dDev[i] |
Probability vs. the change in the standardized deviance with observation i excluded. |
P[i] vs. dBhat[i] |
Probability vs. the change in the standardized maximum likelihood estimators of the model coefficients with observation i excluded. |
P[i] vs. dChisq[i] |
Bubbleplot of
probability vs. the change in the standardized
Pearsons chi-squared
with observation i excluded.
A[i] = pi r[i]^2, r[i] = (dBhat[i] / P[i])^0.5 For details see:
|
The following show leverage h[i] on the x-axis:
h[i] vs. dChisq[i] |
Leverage vs. the change in the standardized Pearsons chi-squared with observation i excluded. |
h[i] vs. dDev[i] |
Leverage vs. the change in the standardized deviance with observation i excluded. |
h[i] vs. dBhat[i] |
Leverage vs. the change in the standardized maximum likelihood estimators of the model coefficients with observation i excluded. |
The correlation of
dChisq, dDev and dBhat.
is shown in a pairs
plot. See:
?graphics::pairs
The Value of dx
is also returned, invisibly.
A choice of colors can be found with e.g.
grDevices::colours()[grep("blue", grDevices::colours())]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## H&L 2nd ed. Table 4.9. Figures 5.5-5.8. Pages 177-180.
data(uis)
uis <- within(uis, {
NDRGFP1 <- 10 / (NDRGTX + 1)
NDRGFP2 <- NDRGFP1 * log((NDRGFP1 + 1) / 10)
})
summary(g1 <- glm(DFREE ~ AGE + NDRGFP1 + NDRGFP2 + IVHX +
RACE + TREAT + SITE +
AGE:NDRGFP1 + RACE:SITE,
family=binomial, data=uis))
plot(g1)
## H&L. Similar to Figure 5.3.
set.seed(133)
(g1 <- glm(sample(c(0, 1), size=100,
replace=TRUE, prob=c(0.5, 0.5))
~ 0 + I(0.08 * rnorm(n=100, mean=0, sd=sqrt(9))),
family=binomial))$coef # approx. 0.8
plot(g1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.