From p.dalgaard at biostat.ku.dk  Wed Oct 25 00:53:46 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 25 Oct 2006 00:53:46 +0200
Subject: [Rd] Cook's Distance in GLM (PR#9316)
In-Reply-To: <20061024222509.A5062B186@slim.kubism.ku.dk>
References: <20061024222509.A5062B186@slim.kubism.ku.dk>
Message-ID: <x2y7r5s4ud.fsf@turmalin.kubism.ku.dk>

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




[Rd] Cook's Distance in GLM (PR#9316)
Peter Dalgaard