Tom La Bone wrote: > 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? > > > It's a bit difficult to know what you might be thinking.
The formula for the hat matrix is X inv(X'WX) X'W and I have some difficulty seeing how you might expect that _not_ to depend on W.... (I suspect that whatever source you used intended to say that the hat matrix does not depend on the observations, with no thought given to the possibility of a weighted analysis.) > 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. > -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ 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.