Dear Statalist users
Thank you Dr. Maarten. The program does answers both my questions - It
does perfectly what I wanted to work on. A quick question now is can I
continue to do the same using -CLAD- (The code for which was written
by Dr. Joliffe) and somehow capture the beta's from the -CLAD-
procedure?
I can thus compare results of the tobit to the CLAD results. I was
wondering if this can be done in the same program (Provided by Dr.
Maarten) - given below
---------------------------Example----------------------------------------
global numobs 500 // sample size N
global numsims "1000" // number of simulations
set seed 678643594
capture program drop simtobit
program simtobit, rclass
version 10.1
drop _all
set obs $numobs
gen x = rnormal()
gen z = rnormal()
gen e = exp(1.5 + z)*rnormal()
gen mu = 5 + x + z
gen ystar = 5 + x +e
gen y = cond(ystar < 0, 0, ystar)
tobit y x z, ll(0)
return scalar b = _b[x]
tempname z
scalar `z' = abs((1-_b[x])/_se[x])
return scalar p = 2*normal(-`z')
end
simulate b=r(b) p=r(p) , ///
reps($numsims): simtobit
sum
hist p, name(p) // should be uniform distribution
hist b, xline(1) name(b)
____________________________________________________________________________
I would greatly appreciate any pointers
Sincerely
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/