Skip to content
Prev 38882 / 63421 Next

buglet in weighted.residuals(mlmObject)

When weighted.residuals() is given a fitted model
object with several responses (class mlm) and some
zero weights it returns a vector instead of a matrix.
It looks like it is doing
   resids[ weights != 0 ]
instead of
   resids[ weights != 0, , drop=FALSE] 
in the multi-response case.

E.g.,
fac=LETTERS[c(1,1,2,2)])
[1]  1.407294e-16 -5.847465e-01  5.205496e-01  5.950102e-16
-2.338986e+00
[6]  2.082198e+00
y1            y2
1  0.000000e+00  0.000000e+00
2  1.407294e-16  5.950102e-16
3 -5.847465e-01 -2.338986e+00
4  5.205496e-01  2.082198e+00

This is in R 2.12.0.  I haven't upgraded yet.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com