[R] Rationale for different Cooks distances in cooks.distance and plot.lm

S Ellison S.Ellison at LGCGroup.com
Wed Jul 27 18:16:03 CEST 2011


 
Is anyone able to offer a reason that, when using weights in an lm fit, the Cook's distances 
shown in plot.lm(x, which=4) differ from those calculated by cooks.distance(x) ?

I can see that they _are_ different and the code tells me _how_ they differ (essentially, one is using the weights and the other isn't). My question is _why_ different calculations are chosen. 

Example:

set.seed(1023)
x<-1:10
s <- (x)/10
y <- rnorm(10, x, s)
l <- lm(y~x, weights=1/s^2)

par(mfrow=c(2,1))
plot(l, which=4)
plot(cooks.distance(l), type="h", main="cooks.distance(l)")


S Ellison
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list