11-20-2013 10:45 AM
I've red an article on the response of pigs to increasing concentrations of isoleucine in their diet. The response was analysed with proc nlin. It is said in the article that they modified the classical broken-stick (or linear-plateau) model into a bentstick model.
I know how to program a broken-stick model but I really don't know how to do with a bent-stick model. In the article the bent-stick model is based on two line segments that are connected by a quadratic function, resulting in a smooth transition between both line segments. So it seems to be a modification of a broken stick model.ent_stick
Does any one can help me please ?
11-20-2013 02:51 PM
Example 63.1 Segmented Model in the NLIN Procedure documentation will get you started. This is a linear plateau following a quadratic. What you want is linear-quadratic-linear. Start by writing the expectation across all X, then apply the continuity and smoothness conditions.
It might be better to fit a spline to the data, with four knots, corresponding to the two ends and the two join points, or a thin-plate spline that accommodates the design.
11-25-2013 08:00 AM
Hi Steve and Mohammad,
Thanks a lot for you answers.
I've used the piecewise regression and applied Steve's advice (expectation across all X + continuity and smoothness).
So I've 3 equations :
which gives :
ods graphics on;
Proc nlin data=Essai_segmentedLQL noitprint plots=(diagnostics fitplot);
parms a1=1 b1=1 b2=1 b3=1 c2=1 X1=10 X2=20;
if (X<=X1) then mean = a1+b1*X;
if (X>X1 AND X<=X2) then mean = a1+X1*(b1-b2)+b2*X+c2*(X*X-X1*X1);
else mean = a1+X1*(b1-b2)+X2*(b2-b3)+c2*(X2*X2-X1*X1)+b3*X;
model Y = mean;
ods graphics off;
It seems to work quite well. There's just an issue with the start parameters. I have to estimate graphically the breakpoints. It is not a problem with one set of data, but it is if I want to run several regression with quite different parameters values. But I think I can handle this.
Thank again for you help.