[Rd] (PR#8877) predict.lm does not have a weights argument for newdata

jranke at uni-bremen.de jranke at uni-bremen.de
Sat May 20 22:49:25 CEST 2006


Dear R developers,

I am a little disappointed that my bug report only made it to the
wishlist, with the argument:

	Well, it does not say it has.
	Only relevant to prediction intervals.

predict.lm does calculate prediction intervals for linear models from 
weighted regression, so they should be correct, right? 

As far as I can see they are bound to be wrong in almost all cases, if
no weights for newdata can be given. So the point is that predict.lm
needs such an argument in order to give correct prediction intervals for
models from weighted linear regression.

Also, it strikes me that in the absence of a "newdata" argument, the
weights from the "lm" object need to be taken into account for
constructing prediction intervals.

My updated proposal fixing both points as well as the help file can be found at:

	http://www.uft.uni-bremen.de/chemie/ranke/r-patches/lm.predict.patch

and I wrote up a small demonstration of the problem and my proposed solution:

	http://www.uft.uni-bremen.de/chemie/ranke/r-patches/lm.predict.pdf

Kind regards,

Johannes Ranke

-- 
Dr. Johannes Ranke                 jranke at uni-bremen.de
UFT Bremen, Leobenerstr. 1         +49 421 218 8971 
D-28359 Bremen                     http://www.uft.uni-bremen.de/chemie/ranke



More information about the R-devel mailing list