Dear all
First
Thank you Martin & other statalist users
Well I did find the book very helpful. Find a program that I have been
able to now develop. But has a few problems
clear all
quietly set obs 30
global numobs 100 // sample size N
global numsims "1000" // number of simulations
set seed 678643594
program tobit, rclass
version 10.1
drop _all
set obs $numobs
scalar a = 0
scalar b = 12
scalar mu = 5
scalar sigma = 4
generate u= runiform()
generate
y=normal((a-mu)/sigma)+u*(normal((b-mu)/sigma)-normal((a-mu)/sigma))
generate ytrunc = mu + sigma*invnorm(y)
generate x = rnormal()
regress ytrunc x
return scalar b2 = _b[x]
return scalar se2 = _se[x]
return scalar t2 = (_b[x]-2)/_se[x]
return scalar r2 = abs(return(t2))> invttail($numobs-2,.025)
return scalar p2 = 2*ttail($numobs-2,abs(return(t2)))
end
simulate b2r=r(b2) se2r=r(se2) t2r=r(t2) reject2r=r(r2) p2r=r(p2), ///
reps($numsims): tobit
mean b2r se2r reject2r
My Questions now are:
1. Since I had generated 'ytrunc' as a truncated normal distribution,
then to know the bias I cannot tell stata to generate 'ytrunc' based
on a equation such as
y = b1 + b2*x + u
where b1 and b2 are specified. But if I do this then y goes to
having a normal distribution and not a truncated normal distribution.
2. Another problem is to develop a heteroskedastic error term. Can I
develop that using
generate u= runiform() * c*z_factor
Where c is a constant varying from 0.1 to 1.0 and the
z_factor changes for each 'i' - then how do I define the z_factor?
I would greatly appreciate any pointers that you could provide me in this
regard
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/