miguel foguel <[email protected]> asks about -ml-:
> I'm trying to estimate a competing risk model using the -ml- routine in
> Stata. I'm using method d0, and so far I've got two problems:
>
> 1) I'm receiving the following message: 'equation # out of range'. What does
> it mean? (Is there a maximum number of equations (as defined for -ml-
> routine) that I can specify in the -mleval- part of the programme?)
The number of equations is determined when you specify them in the -ml model-
statement. For example,
. sysuse auto, clear
. ml model d2 mynormal_d2 (xb: mpg=turn trunk) /lnsigma
specifies 2 equations, but if -mynormal_d2- uses -mleval- with the -eq()-
greater than 2, such as
program mynormal_d2
version 8.1
args todo b lnf g negH g1 g2
tempvar mu lnsigma sigma lngamma
mleval `mu' = `b', eq(1)
mleval `lnsigma' = `b', eq(2)
mleval `lngamma' = `b', eq(3) // <- error
...
end
the subsequent call to -ml max- will result in the following error message
. ml max
equation 3 out of range
r(198);
> 2) My likelihood function does not contain any dependent variable in it. So,
> when calling the -ml model ...-, must I specify a dependent variable anyway?
You shouldn't have to. Make sure your Stata is fully updated; I believe there
was a bug fix a couple months ago, related to using -ml- to optimize without
dependent variables.
--Jeff
[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/