[R] naive "collinear" weighted linear regression

tlumley at u.washington.edu tlumley at u.washington.edu
Fri Nov 13 21:49:39 CET 2009


On Wed, 11 Nov 2009, David Winsemius wrote:

>
> On Nov 11, 2009, at 7:45 PM, Mauricio Calvao wrote:
>

>> When I try:
>> 
>>> fit_mod <- lm(y~x,weights=1/error^2)
>> 
>> I get
>> 
>> Warning message:
>> In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
>> extra arguments weigths are just disregarded.
>
> (Actually the weights are for adjusting for sampling, and I do not see any 
> sampling in your "design".)
>

No, the weights are not for adjusting for sampling.  You will get the wrong standard errors if you put sampling weights into the  `weights` argument.

  The warning is saying that he had misspelt 'weights' as 'weigths' (and so the code he posted wasn' t the same as the code he ran).


      -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list