The NLIN procedure stops processing when a BOOTSTRAP or a PROFILE statement is specified and multiple models are defined using IF-THEN statements


PROC NLIN fails to produce estimation results and returns the following error:

NOTE: The SAS System stopped processing this step because of errors.

This issue occurs when the following conditions are met:

If you specify a PROFILE statement, the following error message also appears in the log:

ERROR: Profiling could not be done. Check the input program.

To avoid the problem, rewrite the model using only one MODEL statement. For example, specify the following model using two MODEL statements defined within IF-THEN statements and no DO groups:

if (x < x0) then model y = alpha + beta*x + gamma*x*x;
else model y = alpha + beta*x0 + gamma*x0*x0;

Rewrite the above model using one MODEL statement with either of the following approaches:

if (x < x0) then mean = alpha + beta*x + gamma*x*x;
else mean = alpha + beta*x0 + gamma*x0*x0;
model y = mean;


model y = (x < x0)*(alpha + beta*x + gamma*x*x) + (x >= x0)*(alpha + beta*x0 + gamma*x0*x0);

Note that you can also avoid the problem by including DO groups as follows:

if (x < x0) then do;
   model y = alpha + beta*x + gamma*x*x;
end;
else do;
   model y = alpha + beta*x0 + gamma*x0*x0;
end;

However, the results produced by the BOOTSTRAP statement or the PROFILE statement are incorrect if you use this workaround. For details, refer to SAS Note 69194, "The NLIN procedure might produce incorrect bootstrapping or profile results when multiple models are specified."