Folks-
So I'm trying to estimate a hurdle model, actually before I do that I'm just trying to replicate the program in Stata Journal Vol 3 Issue 2 (p178), in the "From the help desk" section. It has become maddening. I've gone over the syntax again and again...even cutting and pasting from the pdf. But alas, it will not produce the results in the article. When I run the last line below (ml max, nolog) stata responds with an ' invalid name error. I assume it is choking on the first generate command, but I don't know why.
Any thoughts?
Thanks much
TJ
here is the program:
program hurdle_ll
version 8
args lnf beta1 beta2
tempvar pi lambda
quietly generate double 'pi' = exp('beta1')
quietly generate double 'lambda' = exp('beta2')
quietly replace 'lnf' = cond($ML_y1==0,-'pi', ///
log(1-exp(-'pi')) + $ML_y1*'beta2' - ///
log(exp('lambda')-1) - lngamma($ML_y1+1))
end
ml model lf hurdle_ll (y = x1 x2) (x1 x2)
ml max, nolog
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/