BookmarkSubscribeRSS Feed
e3flator
Calcite | Level 5


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;

  run;

  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;

  run;

quit;

proc model data=vector_def outparms=outparms;

          endogenous x;

          exogenous y;

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

          fit y;

          solve / out=vector_def_out ;

run;

quit;

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

Thanks in advance

Federica

2 REPLIES 2
Reeza
Super User

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

SteveDenham
Jade | Level 19

Federica,

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1788 views
  • 0 likes
  • 3 in conversation