st: Re: Re: Simulating Instrumental Variable Probit Model - Addendum

 From "Martin Weiss" To Subject st: Re: Re: Simulating Instrumental Variable Probit Model - Addendum Date Tue, 21 Apr 2009 19:24:38 +0200

```<>

```
Well, the central problem , i.e. that you do not respect the syntax diagram of -ivprobit-, remains. You probably think that you generated an endogenous variable and Stata should therefore stop complaining. But Stata cannot know what you did a couple of lines earlier. What it does want is that you convey which variable you regard as endogenous and which instruments you supply for the estimator to get down to business...
```

HTH
Martin
_______________________
```
----- Original Message ----- From: "Sachin Chintawar" <schint1@tigers.lsu.edu>
```To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, April 21, 2009 7:08 PM
Subject: st: Re: Simulating Instrumental Variable Probit Model - Addendum

```
```Dear Statalist Users
Well adding to my earlier program I did find a few silly mistakes that
I have cleaned up. Find a newer version of the program with more
doubts.
--------------------------------------------------Start
Example---------------------------------------------------------------------
global numobs 500             // sample size N
global numsims "1000"         // number of simulations
set seed 123456789

capture program drop endoprob

program endoprob, rclass
version 10.1
drop _all
set obs \$numobs
generate u = rnormal(0)
generate mu = rnormal(0)
generate x1 = rnormal(0)
generate z1 = rnormal(0)   // 4 Instruements
generate z2 = rnormal(0)
generate z3 = rnormal(0)
generate z4 = rnormal(0)
// Also be written *drawnorm u mu x1 z1 z2 z3 z4
generate a = 0.5*u
generate x2 = z1 + z2 + z3 + z4 + a
regress x2  z1 z2 z3 z4 mu                // endogenous regressor
with four instruments
predict px2

generate y = 0.5 + 2*x1 + px2 + mu + u>4    //Reduced Form Equation
ivprobit y x1 px2
return scalar b2 = _b[x1]
return scalar b3 = _b[px2]
return scalar se2 = _se[x1]
return scalar se3 = _b[px2]
end
simulate b2=r(b2) b3=r(b3) se2r=r(se2) se3r=r(se3), ///
reps(\$numsims): endoprob
mean b2 b3 se2r se3r
-------------------------------------------End
Example---------------------------------------------------------------------------------
1. Adding to my earlier problem if we run this program an error occurs
suggesting that there is no endogenous variable  and that I use
-probit- . But this totally negates the question I want to answer -
the Amount of bias as we increase the number of instruments?
Any suggestions would be appreciated

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

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