Bookmark and Share

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

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

st: RE: R-squared in -xtivreg2- vs. -xtivreg-

From   "Schaffer, Mark E" <>
To   "" <>
Subject   st: RE: R-squared in -xtivreg2- vs. -xtivreg-
Date   Tue, 1 Oct 2013 10:06:26 +0000


The R-sq reported by xtivreg2 is as described in the help file:

"The R-squared reported by xtivreg2 for the fixed-effects estimation is the "within R-squared" obtained by estimating the equation in mean-deviation form."

In other words, if you demean your data and estimate using OLS or IV, you'll get the same coffs as reported by xtivreg2,fe and the same R-sq.

If, as you say, what Stata's official xtivreg reports is the between and overall R-sqs, and what xtivreg2,fe reports is the within R-sq, then it shouldn't be troubling that they don't match.  (It would be more troubling if R-sqs with different definitions were identical!)

On top of that, if you're doing an IV estimation, then the traditional R-sq doesn't have a ready interpretation, and indeed can go negative, as discussed in the Stata FAQ you cite.  Another reason not to be troubled.


> -----Original Message-----
> From: [mailto:owner-
>] On Behalf Of Max
> Sent: 30 September 2013 21:29
> To: statalist
> Subject: st: R-squared in -xtivreg2- vs. -xtivreg-
> Hello,
> I'm running an IV 2SLS fixed effects regression, and I was wondering why I
> get such different R-squared when I use the built-in -xtivreg- and -xtivreg2-,
> written by Schaffer (
> Particularly troubling is the fact that the R-squared obtained with -xtivreg2- is
> negative, while -xtivreg-'s is positive. I googled around and found a Stata FAQ
> about why R-squareds might be negative or missing, but I couldn't find
> anything explaining why -xtivreg2-'s might be different from Stata's.
> As I understand it, -xtivreg2- reports the "within" R-squared, which is missing
> when I run -xtivreg-. But xtivreg gives me a between and an overall R-
> squared. So, I'm not sure what's going on, and any advice/guidance anyone
> can provide would be very much appreciated.
> Thanks!
> Max
> *
> *   For searches and help try:
> *
> *
> *

Sunday Times Scottish University of the Year 2011-2013
Top in the UK for student experience
Fourth university in the UK and top in Scotland (National Student Survey 2012)

We invite research leaders and ambitious early career researchers to 
join us in leading and driving research in key inter-disciplinary themes. 
Please see for further information and how
to apply.

Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index