Skip to content

Error mean square

3 messages · Murray Jorgensen, Brian Ripley

#
If rb.lm is an lm-object, I can access the error mean square as

s2 <- sum(rb.lm$residuals^2)/rb.lm$df.residual


This seems a bit like hard work for such a commonly wanted quantity. Is
there a better way to do this?

Murray Jorgensen



Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html 
Department of Statistics, University of Waikato, Hamilton, New Zealand 
Email: maj at waikato.ac.nz                            Fax +64-7 838 4155
Phone +64-7 838 4773 home phone +64-7 856 6705  Mobile +64-21 139 5862

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Tue, 18 Sep 2001, Murray Jorgensen wrote:

            
For a model without weights

summary(rb.lm)$sigma^2

or

deviance(rb.lm)/df.residual(rb.lm)


BTW, I don't really know what you mean by `error mean square' (I would say
`residual mean square'), but suspect that when weights are involved you
want the weighted form which each of these compute.
#
At 06:56 AM 18-09-01 +0100, Prof Brian D Ripley wrote:
I know that I didn't ask questions of efficiency, but these two are slower
than
my proposal, especially the one calling summary.
I can't believe that you have never heard the term `error mean square'. Do you
mean that you find it ambiguous, or that it is to be deprecated for some
reason?


Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html 
Department of Statistics, University of Waikato, Hamilton, New Zealand 
Email: maj at waikato.ac.nz                            Fax +64-7 838 4155
Phone +64-7 838 4773 home phone +64-7 856 6705  Mobile +64-21 139 5862

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._