From A.Robinson at ms.unimelb.edu.au  Wed Oct 25 00:25:09 2006
From: A.Robinson at ms.unimelb.edu.au (A.Robinson at ms.unimelb.edu.au)
Date: Wed, 25 Oct 2006 00:25:09 +0200 (CEST)
Subject: [Rd] Cook's Distance in GLM (PR#9316)
Message-ID: <20061024222509.A5062B186@slim.kubism.ku.dk>

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. 

> version  
               _                                          
platform       i386-unknown-freebsd6.1                    
arch           i386                                       
os             freebsd6.1                                 
system         i386, freebsd6.1                           
status         Patched                                    
major          2                                          
minor          4.0                                        
year           2006                                       
month          10                                         
day            03                                         
svn rev        39576                                      
language       R                                          
version.string R version 2.4.0 Patched (2006-10-03 r39576)


Cheers

Andrew

-- 
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
http://www.ms.unimelb.edu.au/~andrewpr
http://blogs.mbs.edu/fishing-in-the-bay/




[Rd] Cook's Distance in GLM (PR#9316)
A.Robinson at ms.unimelb.edu.au