[Gretl-users] strange R^2 with TSLS

Sven Schreiber svetosch at gmx.net
Mon Dec 10 08:50:32 EST 2007


Allin Cottrell schrieb:
> 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.
>
>   

Sorry to leave that unclarified, Jack already pointed out the (simple) 
solution of this pseudo-mystery directly to me. (Trying to not embarrass 
me publicly I guess...) Any linear transformation (or some may call it 
affine) of a single variable will leave the linear correlation with 
another variable unchanged of course. So the estimated coefficients are 
really totally irrelevant in this case.

cheers,
sven


More information about the Gretl-users mailing list