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

Re: st: Questions about -ml- comand

From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: Questions about -ml- comand
Date   Tue, 10 Feb 2004 20:10:36 -0600

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

the subsequent call to -ml max- will result in the following error message

	. ml max

	equation 3 out of range

> 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.

[email protected]
*   For searches and help try:

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