Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Hurdle Model Help


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Hurdle Model Help
Date   Thu, 16 Feb 2006 05:39:06 +0000 (GMT)

TJ:

The program should call local macro's and temporary variable names. Both begin with a ` and end
with a '. Note that ` and ' are not the same. So your programe should be: 

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

HTH,
Maarten

--- Brooks Taggert J <[email protected]> wrote:
> 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) <snip> Any thoughts?
> 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
> 


-----------------------------------------
between 1/2/2006 and 31/3/2006 I will be
visiting the UCLA, during this time the
best way to reach me is by email

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
*
*   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/



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