Skip to content
Prev 139149 / 398506 Next

Mimicking SPSS weighted least squares

Rolf Turner wrote:
I believe case weighting in SPSS effectively replicates the relevant row 
(not sure if anything sensible comes out if weights are non-integer).  So

lm(...., data=mydata[rep(1:nrow(mydata),w),])

or thereabouts should do it. Might not be too efficient though.