Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: e(rmse) for xtreg, re ?

From   Scott Merryman <>
Subject   Re: st: e(rmse) for xtreg, re ?
Date   Fri, 7 Sep 2012 06:35:49 -0500

On Thu, Sep 6, 2012 at 9:10 AM,  <> wrote:
> Dear Stata users,
> I'd like to learn how Stata calculates the root mean square error (e(rmse))
> after fitting a simple linear random-effects model (xtreg, re)...can anyone
> shed some light for me?
> Specifically,
> (1) does the RMSE reported by Stata include all random-components, i.e. u_i
> and e_it,  or simply e_it?
> (2) model degree of freedom:  how is the model degree of freedom defined in the calculation? Does Stata take into account the number
> of clusters, in addition to the number of parameters in the slope of the linear model? One previous post has touched this issue but it didn't talk about random-effects model ( ) ?
> I checked the manual (
> only describes how
> rmse is defined for be and fe options, but not re. I also checked xtreg.ado
> ( but cannot see how e(rmse) is
> defined there.

-xtreg, re- uses the within residuals to calculate the idiosyncratic
error component.

webuse grunfeld,clear
qui xtreg invest kst, fe
predict double e, e
gen double e2 = e^2
sum e2
disp sqrt(r(sum)/(e(N) - e(N_g)  - 2 + 1 ))
qui xtreg invest kst, fe,
disp e(rmse)

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index