Chapter 19, Section 19.3
Mixed Model Representation of Penalized Spline for Log C-Peptide Concentration
data tlc;
data diabetes;
infile 'diabetes.dat';
input age logc;
***************************************************************************************************************;
* Create truncated line functions for piecewise linear curve with 10 knots at ages 5, 6, …,14 *;
***************************************************************************************************************;
bf1 = max(0,age-5);
bf2 = max(0,age-6);
bf3 = max(0,age-7);
bf4 = max(0,age-8);
bf5 = max(0,age-9);
bf6 = max(0,age-10);
bf7 = max(0,age-11);
bf8 = max(0,age-12);
bf9 = max(0,age-13);
bf10 = max(0,age-14);
title1 Mixed Model Representation of Penalized Spline for Log C-Peptide Concentration;
title2 Study of Log C-Peptide Concentration in Children with Diabetes;
proc mixed covtest;
model logc = age / solution outpred=yhat;
random bf1 bf2 bf3 bf4 bf5 bf6 bf7 bf8 bf9 bf10 / type=toep(1) solution;
run;
****************************************************************************************************;
* Use predicted values from the mixed model analysis to produce plot of fitted curve *;
****************************************************************************************************;
proc sort data=yhat;
by age;
proc gplot data=yhat;
plot pred*age;
symbol1 i=j;
run;