[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 <>
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-
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
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')

simulate b=r(b) p=r(p) , ///
    reps($numsims): simtobit

hist p, name(p) // should be uniform distribution
hist b, xline(1) name(b)

I would greatly appreciate any pointers

*   For searches and help try:

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