11.4 - Repeated Measures: Example

Example

For the example dataset Repeated Measures Example Data we introduced in the ‘Correlated Residuals’ section, we can plot the data as follows. 

 
The SGPlot Procedure 9 8 7 6 5 4 3 2 1 1 2 3 time 10 15 20 25 30 35 resp

The values of the response are plotted at each of the three time points for each of the 9 subjects.

We can obtain the results for the split-plot in time approach using the following:

/*Split-Plot in Time */
proc mixed data=rmanova method=type3;
class trt time subject;
model resp=trt time trt*time / ddfm=kr;
random subject(trt); title 'Split-Plot in Time';
run;

Type 3 Analysis of Variance

Source DF Sum of Squares Mean Square Error Term F Value Pr > F
trt 2 64.518519 32.259259 MS(subject(trt)) 7.14 0.0259
time 2 1300.962963 650.481481 MS(Residual) 605.62 < .0001
trt*time 4 41.481481 10.370370 MS(Residual) 9.66 0.0010
subject(trt) 6 27.111111 4.518519 MS(Residual) 4.21 0.0165
Residual 12 12.888889 1.074074      

Next, we run the analysis as a repeated-measures ANOVA, which allows us to evaluate which covariance structure fits best.

/*Repeated Measures Approach*/
/*Fitting Covariance structires: */
/*Note: the code begining with "ods output ..." for each
run of the Mixed procedure generates an output that
is tabulated at the end to enable comparison of
the candidate covariance structure*/
proc mixed data=rmanova;
class trt time subject;
model resp=trt time trt*time / ddfm=kr;
repeated time/subject=subject(trt) type=cs rcorr;
ods output FitStatistics=FitCS (rename=(value=CS))
FitStatistics=FitCSp;
title 'Compound Symmetry'; run;
title ' '; run;
proc mixed data=rmanova;
class trt time subject;
model resp=trt time trt*time / ddfm=kr;
repeated time/subject=subject(trt) type=ar(1) rcorr;
ods output FitStatistics=FitAR1 (rename=(value=AR1))
FitStatistics=FitAR1p;
title 'Autoregressive Lag 1'; run;
title ' '; run;
proc mixed data=rmanova;
class trt time subject;
model resp=trt time trt*time / ddfm=kr;
repeated time/subject=subject(trt) type=un rcorr;
ods output FitStatistics=FitUN (rename=(value=UN))
FitStatistics=FitUNp;
title 'Unstructured'; run;
title ' '; run;
data fits;
merge FitCS FitAR1 FitUN;
by descr;
run;
ods listing; proc print data=fits; run;

We get the following Summary Table:

Obs Descr CS AR1 UN
1 -2 Res Log Likelihood 70.9 71.9 63.0
2 AIC (smaller is better) 74.9 75.9 75.0
3 AICC (smaller is better) 75.7 76.7 82.6
4 BIC (smaller is better) 75.3 76.3 76.2

Using the AICC as our criteria, we would choose the compound symmetry (CS) covariance structure.

The output from this would be:

Type 3 Test of Fixed Effect

Effect Num DF Den DF F Value Pr > F
trt 2 6 7.14 0.0259
time 2 12 605.62 < .0001
trt*time 4 12 9.66 0.0010
Note! The p-values obtained are identical to the split-plot in time approach for this case because a CS covariance structure was used.