BookmarkSubscribeRSS Feed
kathrin_r
Calcite | Level 5

Hi

 

I run the following repeated measure anova in sas (I have 2 treatment groups with 4 repeated measures):

 

PROC GLM DATA=analysisdata;
MODEL PRE FU1 FU2 FU3 = TREAT/ NOUNI;
REPEATED TIME 3 CONTRAST (1) / SUMMARY;
RUN;

 

The treatment*time interaction was significant. Now I would like to test within each treatment group, if there was a significant change over time and if the change between baseline (PRE) and followup1 (FU1) , the change between baseline (PRE) and followup2 (FU2) and the change between baseline (PRE) and followup3 (FU3) were signifiant. How to do these tests in SAS?

Concerning the multiple testing: What kind of adjustment do I have to do? Do I only have to adjust within each treatment group for the fact that I do 3 test (PRE versus FU1,PRE versus FU2 and PRE versus FU3) or does the adjustment have  to be done over the groups (i.e. it would be 6 tests PRE versus FU1,PRE versus FU2 and PRE versus FU3 per group).

Thanks for your help.

 

 

1 REPLY 1
SteveDenham
Jade | Level 19

It has been a very long time since I used PROC GLM to do repeated measures analysis, so I am going to give an answer using what I would do, using PROC GLIMMIX.

 

First, reshape your data from wide to long:

 

data want;

set analysisdata;

value=pre;time=0;output;

value=fu1;time=1;output;

value=fu2;time=2;output;

value=fu3;time=3;output;

drop pre fu1 fu2 fu3;

run;

 

proc glimmix data=want;

class treat time subjectid;

model value=treat time treat*time/ddfm=kr2;

random time/residual type=ar(1) subject=subjectid;

lsmeans treat*time/slicediff=(time treat) slicedifftype=control/adjust=simulate(seed=1) adjdfe=row;

run;

 

This should give the simple effect differences for each time point from the initial time point within each treatment, and the comparisons between treatments at each time point, with adjustment for all comparisons made.  It assumes that there are multiple subjects within each treatment group, indexed by subjectid, and that the time points are equally spaced.

 

Steve Denham

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
  • 1 reply
  • 8236 views
  • 2 likes
  • 2 in conversation