Statalist


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

st: AW: Re: Simulating Instrumental Variable Probit Model


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
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. ...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Sachin
Chintawar
Gesendet: Dienstag, 21. April 2009 18:39
An: statalist@hsphsun2.harvard.edu
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
---------------------------------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[x2hat]
    return scalar se2 = _se[x1]

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

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



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