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]]

