Skip to content
Prev 139209 / 398506 Next

Mimicking SPSS weighted least squares

John Fox wrote:
Actually, I count this as a 3rd variant of weighting. I believe that
SPSS 's standard errors are actually OK for the case where one data line
actually represents a number of identical replicates. To my mind, there
are three (main) kinds of weighting:

(1) Variance weighting (weights proportional to inverse variances)
(2) Case weights (weights identical to number of replicates)
(3) Inverse probability weights (weights inversely proportional to
sampling freq.)

All three give the same point estimates, beta=inv(X'WX)X'WY but the SEs 
and DF are different (W is the diagonal matrix of weights). I think the
formulas are as follows (please correct if I goofed):

in (1) you get sigma^2=Y'(W-WX' inv(X'WX)X'W)Y/(n-rank(X)) ,
                        VCOV= sigma^2 inv(X'WX),

in (3) it is sigma^2=Y'(I-WX inv(X'WX)X') (I- X inv(X'WX)X'W)Y/(n-rank(X)),
                   VCOV=sigma^2 inv(X'WX) X'WWX inv(X'WX)

in both these cases, the DF are n-rank(X)  (glossing over complications
that arise when the weights become zero) and the VCOV are stable to
proportional scaling of W.

in (2) you get sigma^2=Y'(W-WX' inv(X'WX)X'W)Y/(tr(W)-rank(X)),
                         VCOV= sigma^2 inv(X'WX),
               
This is deceptively similar to (1), but notice the denominator of
sigma^2. In this case, multiplying the weights by, say, 2 will roughly
halve the VCOV, which is fair enough since it means that you have twice
as much data.