The R Project SVN R

Rev

Rev 61160 | Rev 64657 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61160 Rev 61168
Line 194... Line 194...
194
plot(xh,yh, main = "Huber's data: L.S. line and influential obs.")
194
plot(xh,yh, main = "Huber's data: L.S. line and influential obs.")
195
abline(lmH); points(xh[im$is.inf], yh[im$is.inf], pch = 20, col = 2)
195
abline(lmH); points(xh[im$is.inf], yh[im$is.inf], pch = 20, col = 2)
196
 
196
 
197
## Irwin's data [Williams 1987]
197
## Irwin's data [Williams 1987]
198
xi <- 1:5
198
xi <- 1:5
199
yi <- c(0,2,14,19,30) # number of mice responding to dose xi
199
yi <- c(0,2,14,19,30)    # number of mice responding to dose xi
200
mi <- rep(40, 5)      # number of mice exposed
200
mi <- rep(40, 5)         # number of mice exposed
201
summary(lmI <- glm(cbind(yi, mi -yi) ~ xi, family = binomial))
201
summary(lmI <- glm(cbind(yi, mi -yi) ~ xi, family = binomial))
202
signif(cooks.distance(lmI), 3)# ~= Ci in Table 3, p.184
202
signif(cooks.distance(lmI), 3)   # ~= Ci in Table 3, p.184
203
(imI <- influence.measures(lmI))
203
(imI <- influence.measures(lmI))
204
stopifnot(all.equal(imI$infmat[,"cook.d"],
204
stopifnot(all.equal(imI$infmat[,"cook.d"],
205
          cooks.distance(lmI)))
205
          cooks.distance(lmI)))
206
}}
206
}}
207
\keyword{regression}
207
\keyword{regression}