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

From |
"Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: Re: st: instrumental variable estimation problems |

Date |
Mon, 7 Dec 2009 12:58:24 -0000 |

Tunga, > -----Original Message----- > From: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of > Tunga Kantarci > Sent: Sunday, December 06, 2009 3:22 PM > To: statalist@hsphsun2.harvard.edu > Subject: Re: Re: st: instrumental variable estimation problems > > Hello, > > * Regarding Question 1: In fact, my question is slightly > wrong but I still > think that it has nothing to do with the ivreg or ivreg2 > command. Let me > state my question again. > > The model is the following. depend = b1 + b2 endo + u. I have two > instruments for endo and I want to test if they are > exogenous. The idea of > the test is that you regress the residuals from this model (using iv > estimates of b1 and b2) on the instruments to see if the > instruments have > explanatory power. Hence the steps are as follows: > Step 1. Obtain the IV estimates of b1 and b2. Here I use > ivregress 2sls > depend (endo = instone insttwo). > Step 2. Obtain the residuals. Here the point is that I wish to get the > residuals using these two iv estimates and the variable > 'endo' and NOT the > 'predicted endo' from the first stage of the 2SLS. Is it ok > if I just use > the command "predict resid, residuals"? Or is this command producing > residuals using the IV estimates of b1 and b2 and the > variable 'predicted > endo'? This question is not about the updated ivreg command. > It is about > getting the correct residuals. (Note: there can be a direct, > ready-made test > for instrument exogeneity but I don't want to follow them. > The test I am > following here is intuitive and therefore I wish to follow > the steps I lay > down here.) The answer to your question is yes, the residuals produced by -predict- are the standard residuals as defined by textbooks etc: they use the actual value of the variable "endo". It looks like you are doing an artificial regression procedure obtain a overid test statistic. If I'm not mistaken, the uncentered R2 from regressing the IV residuals on the instruments is the overid test stat you are calculating. It should be the same numerically as the Sargan statistic produced by -ivreg2-, -overid-, or -estat- following -ivregress-. Cheers, Mark > > * Regarding Question 2 and 3: I appreciate your answers. They > indeed answer > these two questions. My whole confusion arised from a simple > guess: I tought > ivreg was shorthand for ivregress, as is reg for regress. Now > I see that > ivreg is outdated and the whole issue of ivregress and ivreg2 > follows. It is > rather me who created some confusion here. Thank you and to Ekrem. > > Tunga > > > > > > ____________________ > > Tunga: > > Yes, it does matter, and would answer your questions had you > followed the > suggestions provided by Ekrem -- although you would have > needed to do a > little research of your own. > > Note first: > > -ivreg- is, according to the help file, "an out-of-date > command as of Stata > 10." > > -ivreg2- is a user-contributed command. Do the following from Stata's > Command window: > > ssc install ivreg2 > help ivreg2 > > Then read the help file for -ivreg2-, and you will see that > most of your > questions are addressed there. Personally, I would disagree > with Ekrem that > -ivreg2- is necessarily better than -ivregress 2sls- : which > you use is more > a matter of familiarity and convenience. (That said, the help file for > -ivreg2- is a dense tour de force that rewards careful > reading. So too does > <http://fmwww.bc.edu/ec-p/wp667.pdf>. And -help ivregress-, > which would have > allowed you to answer (Q2) and (Q3) by yourself, should be on > your reading > list as well.) > > > In particular: > > (Q1) Tests for endogenous regressors can be accomplished via > -ivendog- after > -ivreg2- or -estat endogenous- after -ivregess 2sls-. It is > not necessary to > go through the steps you propose. > > (Q2) Just as Stata told you, -ivregress depend (endo = > instone insttwo) > exo)- is, indeed, invalid syntax. Ekrem was very explicit in > answering your > question: you need to include the estimator, which in your > case is "2sls". > See -help ivregress- for the correct syntax. > > (Q3) -estat overid- is not a valid command following the > outdated - ivreg-. > It is valid for -ivregres 2sls-, but you did not run that > command ("invalid > syntax"), hence your second error message ("invalid > subcommand overid") as > it was the -ivreg- command that was the last estimator Stata saw. > > > Hope that helps. > > Best, > Mike > > > > On Dec 5, 2009, at 2:54 PM, Tunga Kantarci wrote: > > Hello, > > Sorry, that it is ivreg or ivreg2, does not answer any of my > questions. > > > > > Hello Tunga, > if you use the command "ivreg2", and read the help file , you can > find how to test the endogeneity and overidentification. > For your second question with ivregress, you need to use an option > "2sls" after the command ivregress. But any way, it is better to use > ivreg2 for all your questions. > > Ekrem Kalkan > > 2009/12/4 Tunga Kantarci <tungakantarci@hotmail.com>: > Hello, > > I use Stata 10 and I would like to ask three questions > regarding the iv > estimation with Stata. > > > > Question 1 > Suppose we have the following model: > > depend = b1 + b2 endo + u > > I want to test if endo is endogenous. The procedure is that > you obtain the > IV estimates of b1 and b2 and then obtain the residuals. Here > the point is > that the residuals are obtained using the variable 'endo' and not the > 'predicted endo' from the first stage of the TSLS. > > My question is this: We obtain the IV estimates with the > following command: > > ivreg depend (endo = instone insttwo) exo > > where depend is the dependent variable, endo is the suspicios > endogenous > variable and we have two instruments for it. exo is just an exogenous > variable. I first run this regression. This produces IV > estimates for b1 and > b2. Then I want to get the residuals using these two estimates and the > variable 'endo'. Is it ok if I just use the command "predict resid, > residuals"? Or is this command producing residuals using the > IV estimates of > b1 and b2 and the variable 'predicted endo'? > > > > Question 2 > When I type ivregress instead of ivreg (while running the > model ivreg depend > (endo = instone insttwo) exo) Stata gives the following > error: depend not a > valid estimator. What is the problem here? When I type ivreg > it works, when > I type ivregress I get this error. > > > > Question 3 > When I type "estat overid" after I run the iv regression I > get the following > error: "invalid subcommand overid". Why estat overid command > does not work? > > Thanks. > > > * > * 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/

**References**:**Re: Re: st: instrumental variable estimation problems***From:*Tunga Kantarci <tungakantarci@hotmail.com>

- Prev by Date:
**Re: st: AW: How can I efficiently see which value of a categorical variable corresponds to which label** - Next by Date:
**st: RE: Simulate a skewed variable in stata, sample vs. population skewness** - Previous by thread:
**Re: Re: st: instrumental variable estimation problems** - Next by thread:
**Re: st: instrumental variable estimation problems** - Index(es):

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