Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

From |
Daifeng He <dhe.statlist@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: R2's from xtreg |

Date |
Thu, 17 Nov 2011 23:24:10 -0500 |

Kit, Thanks so much for the help. Great info! Best, Daifeng On Thu, Nov 17, 2011 at 9:51 AM, Christopher Baum <kit.baum@bc.edu> wrote: > <> > On Nov 17, 2011, at 2:33 AM, Daifeng wrote: > >> >> Here is what the Manual Says: the overall R2 corresponds to Eq(1), >> the between R2 corresponds to Eq(2), and the within R2 corresponds to >> Eq(3). (Sorry, the equations are uly and hard to read, but Statlist >> does not allow formatting..) >> >> >> y_it_hat = a + b*x_it (1) >> y_it_bar = a + b*x_it_bar (2) >> (y_it-y_i_bar)= b*(x_it - xi_bar) (3 ) > > In linear regression with a constant term (or with many constant terms), R^2 can always be written as the squared correlation of Y and Yhat. If you do > > webuse grunfeld > xtreg invest mvalue, fe > predict ihat, xb > corr ihat invest > di r(rho)^2 > > you will see that the 'overall' R^2 is this measure: the squared correlation of actual and predicted values. > > If you do the same thing with areg -- areg invest mvalue, absorb(company) -- it gives you a different R^2. However if you save the predicted values and look at their squared correlation with invest, you will get the same R^2 as you do in xtreg, fe as the 'overall' R^2. > > Note that the 'xb' predictions after areg are not the same as those from an equivalent regression; you need the 'xbd' predict option for that. Likewise, for xtreg, fe, it is the xbu option that produces the same predicted values as those from a regression including the dummy variables. > > Kit > > Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html > An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html > An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**Re: st: R2's from xtreg***From:*Christopher Baum <kit.baum@bc.edu>

- Prev by Date:
**Re: st: way to control for repeated measures when using svy: commands?** - Next by Date:
**Re: st: How to generate a table with the outcomes of unit-root tests from unbalanced panel?** - Previous by thread:
**Re: st: R2's from xtreg** - Next by thread:
**st: way to control for repeated measures when using svy: commands?** - Index(es):