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
*
* 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/