Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
jhilbe@aol.com |

To |
statalist@hsphsun2.harvard.edu |

Subject |
RE: st: using ML for hurdle model, invalid syntax error |

Date |
Sat, 23 Oct 2010 11:04:40 -0400 |

Joseph Hilbe Date: Fri, 22 Oct 2010 08:45:26 +0100 (BST) From: Maarten buis <maartenbuis@yahoo.co.uk> Subject: Re: st: using ML for hurdle model, invalid syntax error - --- On Thu, 21/10/10, Leny Mathew wrote:

I'm trying to use the ml function to estimate a hurdle model. <snip> The code is below: ml model lf hurdle_gam (cnew= time tsq) (time tsq) if T <=3 & final==0, robust cluster(ID) ml check

<snip>

args lnf beta1 beta2 lnphi

<snip>

gen double `phi' = exp(`lnphi') = gen double __00000B = exp() invalid syntax

- -ml- calls your evaluator (-hurdle_cam-) with first the name of the variable in which to store the log-likelihood, than the linear predictor of your first equation (-(cnew= time tsq)-), than the linear predictor of the second equation (-(time tsq)-), and since you did not specify a third equation in your -ml model- statement, there will be no third equation. So, even though you specified a third equation called lnphi in the -args- command, that local macro will be empty, so -exp(`lnphi')- will be evaluated as -exp()-, which gives your error. To solve this you need to specify the third equation in your -ml model statement. If you only want it to be a constant you can do that as follows: ml model lf hurdle_gam (cnew= time tsq) (time tsq) /lnphi /// if T <=3 & final==0, robust cluster(ID) Hope this helps, Maarten - -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl - -------------------------- * * * 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/

**Follow-Ups**:**Re: st: using ML for hurdle model, invalid syntax error***From:*Leny Mathew <lenymathewc@gmail.com>

- Prev by Date:
**st: mfx compute after biprobit** - Next by Date:
**st: random intercept and slope Tobit model?** - Previous by thread:
**Re: st: using ML for hurdle model, invalid syntax error** - Next by thread:
**Re: st: using ML for hurdle model, invalid syntax error** - Index(es):