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

 From Sachin Chintawar To statalist@hsphsun2.harvard.edu Subject st: Re: Simulating Instrumental Variable Probit Model - Addendum Date Tue, 21 Apr 2009 11:08:04 -0600

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