06-26-2013 09:24 PM
06-27-2013 10:20 AM
Carefully look at the documentation for PROC NLIN, especially Example 63.1 Segmented model. This fits a quadratic up to an unknown join point, followed by a plateau.
title 'Quadratic Model with Plateau';
proc nlin data=a;
parms alpha=.45 beta=.05 gamma=-.0025;
x0 = -.5*beta / gamma;
if (x < x0) then
mean = alpha + beta*x + gamma*x*x;
else mean = alpha + beta*x0 + gamma*x0*x0;
model y = mean;
if _obs_=1 and _iter_ =. then do;
plateau =alpha + beta*x0 + gamma*x0*x0;
put / x0= plateau= ;
output out=b predicted=yp;
I hope this gets you started on what you wish to do.
06-28-2013 02:09 AM
Thanks so much Steve, and also, does below procedure can also be used for our data? what the difference between this 2 procedures?
INPUT met gain @@;
80 102 85 115 90 125 95 133 100 140
105 141 110 142 115 140 120 142
PARMS a = 102 b = 2.7 c = -0.04;
x = met-80;
x0 = -.5*b / c;
IF x < x0 THEN
MODEL gain = a+b*x+c*x*x;
MODEL gain = a+b*x0+c*x0*x0;
IF _obs_=1 and _iter_ =. THEN DO;
plateau = a+b*x0+c*x0*x0;
x0 = x0+80;
PUT / x0 = plateau= ;
and another question is, how to make a graph like below, thanks a lot.