I am trying to see if there is a trend in a continuous lab value over time. There are 3 timepoints (1=baseline, 2=month 1, 3=month 2). I structured the data such that each patient has 3 records. Most patients have data for all 3 timepoints, but not all.
Is a mixed model appropriate, with repeated time? Or do I use proc reg?
I am relatively new with proc mixed; this is the mixed model I currently have.
proc mixed data=lab covtest;
class time ptno;
model labval = time;
repeated time/subject=ptno type=un;
lsmeans time / cl pdiff adjust=tukey;
ods output LSMeans=lsmeans1;
run;
Type 3 Tests of Fixed Effects
Effect Num DF Den DF F Value Pr > F
time 2 207 137.04 <.0001
Do I use the type 3 tests of fixed effects to determine if there is a trend over time?
IF I want to see the differences between any 2 timepoints, should I use the p-values from the differences of least square means section, or should I do paired t-tests/wilcoxon signed rank?
EDIT: I forgot to say that your PROC MIXED approach is quite good. I wouldn't shift to REG. The Type3 tests are whether at least one time point mean differs from all the rest. That may not be a trend, so...
If you want to look at a trend in time, use an LSMESTIMATE statement.
lsmestimate 'linear time' time -1 0 1;
lsmestimate 'quadratic time' time 1 -2 1;
Note that with 3 time points, for linear time the middle time point has no effect, which is why looking at the quadratic time (or deviation from linearity) is useful.
SteveDenham
EDIT: I forgot to say that your PROC MIXED approach is quite good. I wouldn't shift to REG. The Type3 tests are whether at least one time point mean differs from all the rest. That may not be a trend, so...
If you want to look at a trend in time, use an LSMESTIMATE statement.
lsmestimate 'linear time' time -1 0 1;
lsmestimate 'quadratic time' time 1 -2 1;
Note that with 3 time points, for linear time the middle time point has no effect, which is why looking at the quadratic time (or deviation from linearity) is useful.
SteveDenham
Here is an interpretation: Significant linear means that a straight line fit through the 3 means will have a slope that is significantly different from 0. Significant quadratic tests whether there is a significant deviation from linearity in the means - that while a straight line fits, there is more that should be considered.
In this case, without seeing the means, I would expect that the month1 and month2 means differ from baseline by approximately the same amount. A hockey-stick graph of some sort.
SteveDenham
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.