Statalist


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

st: Re: Re: Monte Carlo Simulation for Heteroskedastic Tobit Model


From   Sachin Chintawar <[email protected]>
To   [email protected]
Subject   st: Re: Re: Monte Carlo Simulation for Heteroskedastic Tobit Model
Date   Fri, 17 Apr 2009 11:12:38 -0600

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/



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