# Re: Re: st: instrumental variable estimation problems

 From Tunga Kantarci To statalist@hsphsun2.harvard.edu Subject Re: Re: st: instrumental variable estimation problems Date Sun, 6 Dec 2009 16:21:37 +0100

```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.)

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:

suggestions provided by Ekrem -- although you would have needed to do a

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

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