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

Re: st: Maximum iterations exceeded with predictnl

From (Roberto G. Gutierrez, StataCorp)
Subject   Re: st: Maximum iterations exceeded with predictnl
Date   Tue, 21 Sep 2004 10:05:35 -0500

Matthew Polisson <> asks:

> I am conducting a multinomial logit with the following command line:

>> mlogit y x1 x2 etc

> The dependent variable y takes on four values (1, 2, 3, and 4). Following
> the regression, I calculate predicted probabilites for each of the four
> outcomes using the command line:

>> predict p1 p2 p3 p4, pr

> I wish to establish confidence intervals, and the way I know to do this is
> to enter four separate commands as follows:

> predictnl p1 = predict(outcome(1)), ci(p1_l p1_u)
> predictnl p2 = predict(outcome(2)), ci(p2_l p2_u)
> predictnl p3 = predict(outcome(3)), ci(p3_l p3_u)
> predictnl p4 = predict(outcome(4)), ci(p4_l p4_u)

> This works about half of the time, but the other half of the time I receive
> an error message reading:
> 'Maximum number of interations exceed.'

> [...]

In cases where you get the error message, -predictnl- is having a hard time
finding an optimal step size with which to calculate the numerical derivative
of the prediction wrt the estimated parameters.  This derivative is necessary
to get delta-method standard errors, confidence intervals, etc.

A nonconvergence of the step-size search can be caused by many things, but one
of the first things I always check are the scales of the dependent variables
used in the model.  If one or more are very large or very small, then
rescaling the variables will usually do the trick.  

Matthew can either try this technique or, since he is using -mlogit-, download
Bill Sribney's -mlogpred- command that gets delta-method standard errors and
CIs for predictions after -mlogit-.  Since -mlogpred- is hard-wired to
-mlogit-, it uses analytical derivatives and thus won't suffer from any
convergence problems.  You can obtain -mlogpred- by typing

   . findit mlogpred

and following the links.

*   For searches and help try:

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