[R] naive "collinear" weighted linear regression
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Sat Nov 14 22:57:42 CET 2009
Mauricio O Calvao wrote:
> Unfortunately you eschewed answering objectively any of my questions; I insist
> they do make sense. Don't mention the data are perfect; this does not help to
> make any progress in understanding the choice of convenient summary info the lm
> method provides, as compared to what, in my humble opinion and in this specific
> particular case, it should provide: the covariance matrix of the estimated
> coefficients...
The point is that R (as well as almost all other mainstream statistical
software) assumes that a "weight" means that the variance of the
corresponding observation is the general variance divided by the weight
factor. The general variance is still determined from the residuals, and
if they are zero to machine precision, well, there you go. I suspect you
get closer to the mark with glm, which allows you to assume that the
dispersion is known:
> summary(glm(y~x,family="gaussian"),dispersion=0.3^2)
or
> summary(glm(y~x,family="gaussian",weights=1/error^2),dispersion=1)
--
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
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list