<>
Well, it does run for "4.5", and as you -set seed- you should get the same
behavior. Note I alerted you to the fact that "4" was just a guess on my
part. What you can do is sneak a
*************
proportion y
*************
into your -program- after the last -generate- and let it run to see what
kind of distribution of "y" you get from the statement. For the case of "4",
it is 98% vs 2%, which may or may not be what you want.
Also note that an error is easier to diagnose when you run the -prog- by
typing "endoprob" than when -simulate- executes it.
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Sachin
Chintawar
Gesendet: Montag, 27. April 2009 01:42
An: [email protected]
Betreff: st: Probit Model with Instrumental variables
Dear All
Well I did find why the results were contrary to the results published
by Buse. I did notice one thind that Martin help me do but cannot
figure out why and hope someone could help me
When I use the statement -generate y = 0.5 + 2*x1 + x2hat + mu + u>4-
the y generated is 1 or 0 with "4' from which on we want the dependent
to be 1. Unfortunately when I change the value from "4" to anything
above then it does not work giving an error message that
"May not drop an endogenous regressor".
This has left me puzzled and stumped. Any help would be greatly appreciated.
Thanks
Sachin
---------------------------------------Start
Example------------------------------------------------------;
global numobs 500 // sample size N
global numsims "500" // 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 v = rnormal(0)
//generate x = 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.4*u
generate x = 0.5 + 0.1*z1 + a
regress x z1 // endogenous regressor with four instruments
predict px
generate y = 0.5 + px + mu + u > 4 //Reduced Form Equation
ivprobit y (x= z1 )
predict py
end
simulate _b _se y py , ///
reps($numsims): endoprob
mean x* y*
--------------------------------------------------------End
Program-------------------------------------------------------------
*
* 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/