[R] Residual variance from rlm?

From: Talbot Katz <topkatz_at_msn.com>
Date: Fri 26 Jan 2007 - 19:21:06 GMT


This is a real basic question about results from rlm. I want to compute the properly scaled residual variance.

Suppose M is my rlm result object; my example regression is against two variables, and based on 225 observations. summary(M) tells me that
"Residual standard error: 0.0009401 on 222 degrees of freedom" which I presume is the same result as

summary(M)$sigma:	0.0009401223
Then, summary(M)$sigma^2:	8.8383e-07

Is the value of summary(M)$sigma^2 the proper residual variance? If so, I'd like to be able to replicate that from M$wresid and M$w, but I haven't been able to. For example,

var(M$wresid*M$w) = sum((M$wresid*M$w)^2)/224		6.350269e-07
mean(M$wresid^2*M$w) = sum(M$wresid^2*M$w)/225		9.45235e-07
Note that sum(M$w)		205.8032
I was disappointed to find that M$df.residual was NA; however, summary(M)$df 
does return a vector:	3 222   3

I have tried a bunch of other combinations of M$wresid and M$w, but nothing I've tried comes out the same as summary(M)$sigma^2.

Again, is summary(M)$sigma^2 the proper residual variance? If yes, can it be replicated from the M object? If no, can I compute the proper value from the M object?


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Jan 27 06:25:38 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 26 Jan 2007 - 20:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.