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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: Display of Shea's partial R^2 in ivreg2 output


From   "Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Display of Shea's partial R^2 in ivreg2 output
Date   Fri, 26 Feb 2010 20:04:05 -0000

Tom,

The answer to this is interesting because it turns out that Shea's
partial R-sq is very closely related to the R-sq that is a byproduct of
calculating the Angrist-Pischke first-stage F-stats.

Specifically, here is how you calculate the AP partial R-sq vs. the Shea
partial R-sq:

A-P R-sq:

1.  Get the fitted values of the uninteresting endogenous regressors.
2.  Partial (1) out of the endogenous regressor of interest.
3.  Partial (1) out of the excluded instruments.
4.  Regress (2) on (3).
5.  R-sq is AP R-sq.

Shea partial R-sq

1.  Get the fitted values of the uninteresting endogenous regressors.
2.  Partial the ACTUAL uninteresting endogenous vars out of the
endogenous regressor of interest.
3.  Partial (1) out of the excluded instruments.
4.  Regress (2) on (3).
5.  R-sq is Shea R-sq.

Below is a demonstration with the toy auto dataset.

Because the A-P approach has a sounder theoretical foundation than the
Shea approach, we decided to drop the Shea partial R-sq from the main
output in favour of the A-P stats.

Cheers,
Mark

******************************

sysuse auto, clear

* AP stat

* 1.  Get the fitted values of the uninteresting endogenous regressors.
* 2.  Partial (1) out of the endogenous regressor of interest.
* 3.  Partial (1) out of the excluded instruments.
* 4.  Regress (2) on (3).
* 5.  R-sq is AP R-sq.

qui reg weight turn trunk length displacement
capture predict double weight_hat, xb

qui reg mpg weight_hat
capture predict double mpg_what_resid, resid

qui reg turn weight_hat
capture predict turn_what_resid, resid
qui reg trunk weight_hat
capture predict trunk_what_resid, resid
qui reg length weight_hat
capture predict length_what_resid, resid

reg mpg_what_resid turn_what_resid trunk_what_resid length_what_resid,
nocons dof(69)
di e(r2)

* Shea partial R-sq

* 1.  Get the fitted values of the uninteresting endogenous regressors.
* 2.  Partial the ACTUAL uninteresting endogenous vars out of the
endogenous regressor of interest.
* 3.  Partial (1) out of the excluded instruments.
* 4.  Regress (2) on (3).
* 5.  R-sq is Shea R-sq.

qui reg mpg weight
capture predict double mpg_wactual_resid, resid

reg mpg_wactual_resid turn_what_resid trunk_what_resid
length_what_resid, nocons dof(69)
di e(r2)

* Check Shea vs AP partial R-sqs from ivreg2

qui ivreg2 price (mpg weight = turn trunk length displacement), ffirst
mat first=e(first)
mat APr2=first["APr2",1]
mat sheapr2=first["sheapr2",1]
mat list APr2
mat list sheapr2

******************************

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu 
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Tom Palmer
> Sent: 26 February 2010 19:48
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Display of Shea's partial R^2 in ivreg2 output
> 
> Dear Statalist,
> 
> I put the following query to the authors of -ivreg2-. I'm 
> posting it here so the answer can be shared on the list.
> 
> In previous versions of -ivreg2- when specifying the -first- 
> or -ffirst- options Shea's partial R^2 for the instruments 
> was displayed in the output like the following:
> 
> Summary results for first-stage regressions
> -------------------------------------------
> 
> Variable    | Shea Partial R2 |   Partial R2    |  F(  1,  
> 4792)    P-value
> zlnfat9     |     0.0082      |     0.0082      |       39.83 
>       0.0000
> 
> 
> I'm not sure when the change was made but in the latest 
> version (3.0.01) the partial R^2 is no longer shown with 
> these options. (I know it is still available in the returned 
> -e(first)- matrix.)
> 
> I find the partial R^2 very useful in comparing the strength 
> of different instruments so I was wondering if it would it be 
> possible reintroduce the display the partial R^2 in the 
> output of future versions? (I accept typing "mat list 
> e(first)" after -ivreg2- is not too onerous!)
> 
> I also take this opportunity to thank you for an 
> extraordinarily comprehensive command.
> 
> best regards,
> 
>   Tom
> 
> 
> *
> *   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/
> 


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


*
*   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/


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