Hi,
I am running a linear mixed model with random intercept using glimmix to estimate the blood pressure over time of participants in a randomized control trial. I use a spline function to account for the sharp changes in blood pressure I observed over a treatment period, and my study question is if the blood pressure (bp) trajectory differ by treatmentgroup and exposureofinterest.
Here is my SAS code:
proc glimmix data=data order=formatted;
class visit release_id year treatmentgroup covariate1 covariate2 covariate3;
effect spl=spline(year/basis=bspline degree=3 KNOTMETHOD=list(1,4) details);
model bp= spl|treatmentgroup|exposureofinterest
covariate1 covariate2 covariate3
/solution;
random intercept/type=un sub=release_id;
store model;
run;
proc plm source=model;
effectplot slicefit(x=y sliceby=exposureofinterest plotby=treatmentgroup)/clm;
run;
I can visualize the effect using the effectplot function, however, I wonder if there's a way to output the effect estimate at each cross-section of time, ie. year=1 year=2? (is it possible to use the estimate and contrast function? but since year is included in the spline but not as a variable in the model, how do I specify time?
I also tried using the score function to output one unit of change in exposureofinterst by treatmentgroup, hoping to obtain just the effect estimate using the following code. But I am not getting any predicted lclm uclm. Is there anything wrong with my code?
data template;
do intercept=0;
do &x._0_L2=1;
do SEX=0;
do B_AGEGROUP=0;
do RACE=0;
do B_edu=0;
do B_income=0;
do B_married=0;
do B_ALC_DAY=0;
do B_smoke=0 ;
do DASH=0;
do assign="Lifestyle";
do y=0 to 10 by 0.5;
output;
end;
end;
do assign="Placebo";
do y=0 to 10 by 0.5;
output;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
run;
data template;
set template;
*calculate the predicated values for each value of t;
proc plm restore=plot2;
score data=template out=estimate predicted=predicted lclm=lclm uclm=uclm;
run;
Thanks.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.