Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: d0 and Log-logistic hazard


From   [email protected] (Roberto G. Gutierrez, StataCorp.)
To   [email protected]
Subject   Re: st: d0 and Log-logistic hazard
Date   Tue, 27 Aug 2002 15:41:11 -0500

Alfonso Miranda <[email protected]> asks:

> I am trying to write a d0 maximum likelihood code for estimating a
> split-population duration model with gamma unobserved individual
> heterogeneity and log-logistic hazard. The estimation strategy finds first
> initial values from streg and set the initial probability of never fail to
> 2%. Then the ml code is used. I already checked that my log-likelihood is
> correctly written and the ml check is ok. But still Stata finds that the
> log-likelihood function is not concave and does not converges. Having this
> in mid, and in the spirit to find my potential mistake, I tried to create a
> d0 code for the standard duration model with gamma unobserved individual
> heterogeneity from lloghet_glf. Basically I did no changes to the code but
> take away the part that refers to d1 and d2 methods. Running this
> alternative program I learned that Stata does the same: it keeps saying that
> the log-likelihood function is not concave and it does not converges. Hence,
> it seems that the problem is not in the d0 code. Why is this is happening?
> Is it that a d1 (or maybe a d2) method is required whenever a log-logistic
> model is to be estimated?

> Could you give me some hint on what further action should I take?

[contents of .do file omitted]

You were close.  In your do file (which I do not list in order to keep 
this brief) you had the lines:

local t = _t 
local d = _d

You should change these to

local t  _t 
local d  _d

and everything will work just fine.  The difference between the two contructs
is that the first envokes Stata's expression evaluator, which evaluates "_t"
to be the value of the first observation of the variable _t, which in effect
sets the local t to be a constant.

The second construct is what you want.  By not using the equal sign, you are
performing literal string substitution, which will set the local macro t to
contain the string "_t".  That is, the macro t will always refer to the
variable _t in your data, as it is supposed to when you want the refer to part
of the response in a survival model.

--Bobby
[email protected]
*
*   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