# [R] Residual variance from rlm?

Talbot Katz topkatz at msn.com
Fri Jan 26 20:21:06 CET 2007

```Hi.

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?

Thanks!

--  TMK  --
212-460-5430	home
917-656-5351	cell

```