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

st: AW: Re: Simulating Instrumental Variable Probit Model

From   "Martin Weiss" <>
To   <>
Subject   st: AW: Re: Simulating Instrumental Variable Probit Model
Date   Tue, 21 Apr 2009 18:44:32 +0200


Well, a mandatory part of the syntax of -ivprobit- is "(varlist2 =
varlist_iv)", as you can see from its syntax diagram. You have not provided
this information to it in your -program-. So it complains...

BTW, not (yet) a Dr. ...


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Sachin
Gesendet: Dienstag, 21. April 2009 18:39
Betreff: st: Re: Simulating Instrumental Variable Probit Model

Thank You Dr. Martin
Well I did make the changes and got my program to do most of what I
really wanted to do - except for a few problems. Below is the program
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[x2hat]
    return scalar se2 = _se[x1]

    return scalar se3 = _b[x2hat]
simulate b2=r(b2) b3=r(b3) se2r=r(se2) se3r=r(se3), ///
    reps($numsims): endoprob

Every time I run the program, there is an error suggesting that there
is no endogenous variable and that I need to use just probit. This
totally negates the point of doing my simulation. Did I specify the
program wrong in some way? and if so what I can do to mend it?
Any help would be really appreciated.
Thank you
*   For searches and help try:

*   For searches and help try:

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