Skip to content

how to get Residual Standard Error

2 messages · Zhongming Yang, Uwe Ligges

#
Thanks for your answer.

But I really want to know whether I can get "Residual Standard Error",
directly. If I use summary(), there is an item "Residual Standard
Error". So I think we might can access this information directly.

Thanks again,
Call:
loess(formula = y ~ x)

Number of Observations: 10 
Equivalent Number of Parameters: 4.95 
Residual Standard Error: 8.734e-16 
Trace of smoother matrix: 5.47 

Control settings:
  normalize:  TRUE 
  span      :  0.75 
  degree   :  2 
  family   :  gaussian
  surface  :  interpolate         cell = 0.2
"Zhongming Yang" <Zhongming.Yang at cchmc.org> writes:
"Residual
A preferred way would be to use
 sqrt(deviance(fm)/df.residual(fm))
if fm is your fitted model. 

pFor example
Call:
lm(formula = optden ~ carb, data = Formaldehyde)

Residuals:
        1         2         3         4         5         6 
-0.006714  0.001029  0.002771  0.007143  0.007514 -0.011743 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 0.005086   0.007834   0.649    0.552    
carb        0.876286   0.013535  64.744 3.41e-07 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

Residual standard error: 0.008649 on 4 degrees of freedom
Multiple R-Squared: 0.999,	Adjusted R-squared: 0.9988 
F-statistic:  4192 on 1 and 4 DF,  p-value: 3.409e-07
[1] 0.0086487

______________________________________________
R-help at stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
#
Zhongming Yang wrote:
Well, you can get it with summary(x)$sigma, if class(x) == "lm"
(Attention: it might be completely different for other classes!).
summary() calculates much more than this value, thus it is much faster
to calculate it *directly*, i.e. in the way Douglas Bates already
pointed out.

Uwe Ligges