I have a puzzle as to how R is computing Cook's distance in weighted linear
regression.
In
this case cook's distance should be given not as in OLS case by
h_ii*r_i^2/(1-hii)^2 divided by k*s^2 (1)
(where r is plain unadjusted residual, k is number of parameters in model,
etc. )
but rather by
w_ii*h_ii*r_i^2/(1-hii)^2 divided by k*s^2, (2)
i.e. has the weight in there. Apart from the division this is sum of
weighted squares of differences
yhat_j - yhat_j[i]. (That is, it is the weighted sum of squares of fits
minus fits with ith point deleted.)
However, a little experimentation in R, using ls.diag(fit)$cooks, suggests
that in weighted case R gives (1) times some constant. Does anybody know how
that constant is calculated? What is the rationale for
using equation (1) (times a constant) in the weighted case anyway?
Thanks.
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html