Pregunta

I have a question about SAS-proc nlin.

I'm performing the procedure for 10000 simulations. Lots of them do not converge and give me wrong results.

I would like to add a binary variable to my output table that says that this itteration did not converge.

Does anyone know how to do that ?

Many thanks,

Perry

¿Fue útil?

Solución

You need to use ODS to pull the ConvergenceStatus output from PROC NLIN. Add it to your procedure code like this:

PROC NLIN data = ...;
  ...;
  ods output ConvergenceStatus = conv;
RUN;

That gives you a data set with two variables:

  1. Status (0 means convergence, otherwise 1, 2, or 3 are described here: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_nlin_sect031.htm).
  2. Reason (description of the convergence issue).

So attach the results of that data set to each simulation round, and create a binary indicator for whether status > 0, and you should be all set.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top