[Rd] Cook's Distance in GLM (PR#9316)
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Wed Oct 25 00:53:46 CEST 2006
A.Robinson at ms.unimelb.edu.au writes:
> Hi Community,
>
> I'm trying to reconcile Cook's Distances computed in glm. The
> following snippet of code shows that the Cook's Distances contours on
> the plot of Residuals v Leverage do not seem to be the same as the
> values produced by cooks.distance() or in the Cook's Distance against
> observation number plot.
>
> counts <- c(18,17,15,20,10,20,25,13,12)
> outcome <- gl(3,1,9)
> treatment <- gl(3,3)
> d.AD <- data.frame(treatment, outcome, counts)
> glm.D93 <- glm(counts ~ outcome + treatment, family=poisson())
>
> opar <- par(mfrow=c(2,1))
> plot(glm.D93, which=c(4,5))
> par(opar)
>
> cooks.distance(glm.D93)
>
> The difference is reasonably moderate in this case. My suspicions
> were aroused by a case in which the plot showed five or size points
> greater than 1, none of which could be identified in the output of the
> function.
Hmm, yes. A good guess is that the contour levels need to be modified
by a dispersion factor. The plot is much more consistent with
cooks.distance(glm.D93,dispersion=5.129/4 )
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-devel
mailing list