BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tka726
Obsidian | Level 7

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

 

View solution in original post

4 REPLIES 4
SteveDenham
Jade | Level 19

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

 

tka726
Obsidian | Level 7
Thank you!
The p-value for 'linear time' and 'quadratic time' are both significant. I understand that the significant p-value for linear time means that there is a difference in lab value between time 1 and time 3, but I don't exactly understand what the significant p-value for quadratic time means...?
SteveDenham
Jade | Level 19

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

tka726
Obsidian | Level 7
Thank you so much, this is perfect! And you are absolutely right - the graph looks like a boomerang.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 929 views
  • 1 like
  • 2 in conversation