Bookmark and Share

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]

Re: st: using ML for hurdle model, invalid syntax error


From   Leny Mathew <lenymathewc@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: using ML for hurdle model, invalid syntax error
Date   Sat, 23 Oct 2010 16:56:05 -0400

As a matter of fact, I used your log gamma program to get the gamma
likelihood correct, but using the nblogit as a whole never crossed my
mind. That will make this exercise much easier. Thanks!!

On Sat, Oct 23, 2010 at 11:04 AM,  <jhilbe@aol.com> wrote:
> I may be missing something since I just saw your last correspondence
> regarding hurdle models,
> but why don't you use the same logic of using ML for creating hurdle models
> as I did when writing
> poisson-logit, poisson-probit, poisson-clog, NB-logit, NB-probit, and
> NB-clog hurdle models that were
> posted to the SSC site a several years ago.  If you wish to rewrite the
> models, or to create others, it is
> easy to adapt the commands already done, or amend them, for your purposes.
>
> 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/
>

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index