Skip to content
Prev 3985 / 398513 Next

using weights in lm()

On Tue, 7 Dec 1999, Wolfgang Koller wrote:

            
?lm says:

 weights: an optional vector of weights to be used in the
          fitting process.

That means it does weighted least-squares with weights w, minimizing
sum(w*e*e) where e = y - X %*% b. I assume that you want weights = 1/v,
as that gives the MLE, but what you use is a modelling decision
(and I am working in fMRI where people deliberately do not use the MLE
weighting).

If it had said it did weighted least squares with weights w, would
that have been clear enough?