[R] lm methods inconsistency?
maechler at stat.math.ethz.ch
Mon Jan 10 17:39:33 CET 2000
>>>>> "Tom" == Tomislav Goles <tom at ait-tech.com> writes:
Tom> I'm very new to R so maybe i'm doing something wrong so
Tom> please let me know it that is that case.
Tom> Here is an example where the summary() and residuals()
Tom> applied to lm object produce different results
Tom> (I think the residuals() results is correct since SAS produces
Tom> those numbers - the second residual corresponding to observation
Tom> with weight 4 is wrong in summary()).
Tom> x <- c( 10, 20, 30, 40 )
Tom> y <- c( 33.8, 62.2, 92.0, 122.4 )
Tom> w <- c( 1, 4, 1, 1 )
Tom> lm.obj <- lm( y ~ x, weights=w )
Tom> print( summary( lm.obj ) )
(showing the weighted residuals)
Tom> print( residuals( lm.obj ) )
(showing the raw residuals)
No real bug here.
One could argue that summmary() should say
"Weighted residuals:" instead of
(but note that R's behavior here is really like S').
Tom> Best regards,
Tom> Tomislav Goles
Tom> PS. my version or R is 0.64.2 on Linux.
which is *really* too old.
but it doesn't matter here...
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help