/* AIDS Clinical Trial Group (ACTG) 193A Study */ data cd4; infile 'c:/stat565/data/cd4data.txt'; input id group age sex week logcd4; /* Create new variable combining groups 1, 2, and 3 */ trt=0; if (group=4) then trt=1; week_16=max(week - 16, 0); run; proc sort data=cd4; by trt; proc loess data=cd4; by trt; model logcd4=week / degree=1 smooth=0.5; ods output OutputStatistics=Results; run; proc sort data=Results; by trt week; run; symbol1 color=black value=none interpol=join line=1; symbol2 color=black interpol=join value=none line=3; /* macro used in subsequent examples */ axis1 label=(angle=90 rotate=0); proc gplot data=Results; plot Pred*week=trt/ vaxis=axis1 haxis=axis2 hm=3 vm=3; run; proc print data=results; run; proc mixed data=cd4 method=reml noclprint=10 covtest; class id; model logcd4 = week week_16 trt*week trt*week_16 / solution chisq; random intercept week week_16 / subject=id type=un g gcorr solution; ods output solutionR=bluptable; run; proc mixed data=cd4 method=reml noclprint=10 covtest; class id; model logcd4 = age sex week week_16 trt*week_16 / solution chisq outpred=yhat; random intercept week week_16 / subject=id type=un g gcorr solution; run; /* Print First 60 Predicted Means */   proc print data=yhat (obs=60); run; /* print first 60 Empirical BLUPs */ proc print data=bluptable (obs=60); run;