Programming the statistical procedures from SAS

non linear regression

Occasional Contributor
Posts: 5

non linear regression

Hi, I've to approximate some data using non linear regression. Both PROC MODEL and PROC NLIN do "non linear regression" which one is better?

I've tried both on some sample data. The PROC NLIN gives results, instead the PROC MODEL gives this error:

ERROR: The Newton method Jacobian matrix of partial derivatives of the equations with respect to

       the variables to be solved is singular at observation 1, for iteration 2. The system of

       equations cannot be solved.

  data vector_def;

    x=1; y= 0.00; output;

    x=2; y= 0.00; output;

    x=3; y= 0.00; output;

    x=4; y= 0.05; output;

    x=5; y= 0.06; output;

    x=6; y= 0.07; output;

    x=7; y= 0.06; output;

    x=8; y= 0.15; output;

    x=9; y= 0.18; output;

    x=10; y= 0.30; output;

    x=11; y= 0.71; output;

    x=12; y= 0.80; output;

    x=13; y= 1.83; output;

    x=14; y= 2.51; output;

    x=15; y= 3.99; output;

    x=16; y= 7.58; output;

    x=17; y= 24.32; output;


  proc nlin data=vector_def method=newton ;

           parms b0=1 b1=0.2 b2=0 to 0.4 by 0.1;

           model y=b0*exp(b1*x)+b2;

          output out=fitexp p=yfit r=resid;



proc model data=vector_def outparms=outparms;

          endogenous x;

          exogenous y;

          y = b0 * exp(b1*x) + b2;

          fit y;

          solve / out=vector_def_out ;



Is there a macro variable to intercept the proc model error?

Thanks in advance


Super User
Posts: 20,727

Re: non linear regression

Do you have time series data?

If so then you need to work with Model, if not then you can try working with NLIN and NLMIXED

Respected Advisor
Posts: 2,655

Re: non linear regression


You have confused the endogenous and exogenous variables in PROC MODEL.  The independent variable x should be in the exogenous statement and the dependent variable y in the endogenous statement.

Good luck.

Steve Denham

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation