Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RMSE


From   "Steichen, Thomas J." <SteichT@rjrt.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RMSE
Date   Tue, 25 Apr 2006 20:30:21 -0400

Daniel Schneider writes:
> I have encountered a small problem with calculating the RMSE 
> by hand and comparing it to the Stata output and I was wondering 
> if anyone has an explanation (or more precisely: what is wrong 
with the way I calculate the RMSE?):
> 
> . sysuse lifeexp
> (Life expectancy, 1998)
>  
> . quietly: regress popgrowth safewater
> 
> . display e(rmse)
> .84918997
> 
> . predict resid,res
> (28 missing values generated)
> 
> . gen resid2=resid^2
> (28 missing values generated)
> 
> . sum resid2
> 
>     Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>       resid2 |        40    .6850674    .8970437   .0050698    3.46198
> 
> . display sqrt(.6850674)
> .82768798


The answer is that you have not accounted for the two degrees of freedom
attributed to the regression... The error df is 38 here.

Try . display sqrt(.6850674 * 40/38)

Tom

-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be
unlawful.


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index