From jranke at uni-bremen.de  Sat May 20 22:49:25 2006
From: jranke at uni-bremen.de (jranke at uni-bremen.de)
Date: Sat, 20 May 2006 22:49:25 +0200 (CEST)
Subject: [Rd] (PR#8877) predict.lm does not have a weights argument for
	newdata
Message-ID: <20060520204925.1E26919B2C@slim.kubism.ku.dk>

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



[Rd] (PR#8877) predict.lm does not have a weights argument for newdata
jranke at uni-bremen.de