I understand that the hat matrix is a function of the predictor variable
alone. So, in the following example why do the values on the diagonal of the
hat matrix change when I go from an unweighted fit to a weighted fit? Is the
function hatvalues giving me something other than what I think it is?

 

library(ISwR)

data(thuesen)

attach(thuesen)

 

fit <- lm(short.velocity ~ blood.glucose)

summary(fit)

hatvalues(fit)

 

W <- 1/blood.glucose

fit.w <- lm(short.velocity ~ blood.glucose,weights=W)

summary(fit.w)

hatvalues(fit.w)

 

Thanks for the help.

 

Tom

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to