On Thu, 6 Dec 2007, Sven Schreiber wrote:
> On the original issue of R^2, I'll file the bug report
soon.
>
"Delay that order"... Actually for my real-world cases it turns
out there isn't anything (obviously) wrong. However, I'm still
puzzled by the 3-liner results I posted earlier. The point
estimates are quite different between ols and tsls -- then how
come the correlation between fitted and observed is the same to
five or six digits of precision? Hm.
"Strange but true". It seems to be in the arithmetic for the case
of one independent variable and one instrument.
nulldata 50
genr x = normal()
genr y = normal()
genr z = normal()
ols y 0 x
ols x 0 z --quiet
genr xhat = $coeff(const) + $coeff(z)*z
ols y 0 xhat
genr yhat = $coeff(const) + $coeff(xhat)*x
R2 = corr(y, yhat)^2
"R2" is numerically identical to the R^2 from the first OLS.
Left as an exercise: prove that this is always the case.
Allin.