The GLM Procedure

Example 47.7 Repeated Measures Analysis of Variance

(View the complete code for this example.)

This example uses data from Cole and Grizzle (1966) to illustrate a commonly occurring repeated measures ANOVA design. Sixteen dogs are randomly assigned to four groups. (One animal is removed from the analysis due to a missing value for one dependent variable.) Dogs in each group receive either morphine or trimethaphan (variable Drug) and have either depleted or intact histamine levels (variable Depleted) before receiving the drugs. The dependent variable is the blood concentration of histamine at 0, 1, 3, and 5 minutes after injection of the drug. Logarithms are applied to these concentrations to minimize correlation between the mean and the variance of the data.

The following SAS statements perform both univariate and multivariate repeated measures analyses and produce Output 47.7.1 through Output 47.7.7.

data dogs;
   input Drug $12. Depleted $ Histamine0 Histamine1
         Histamine3 Histamine5;
   LogHistamine0=log(Histamine0);
   LogHistamine1=log(Histamine1);
   LogHistamine3=log(Histamine3);
   LogHistamine5=log(Histamine5);
   datalines;
Morphine      N  .04  .20  .10  .08
Morphine      N  .02  .06  .02  .02
Morphine      N  .07 1.40  .48  .24
Morphine      N  .17  .57  .35  .24
Morphine      Y  .10  .09  .13  .14
Morphine      Y  .12  .11  .10   .
Morphine      Y  .07  .07  .06  .07
Morphine      Y  .05  .07  .06  .07
Trimethaphan  N  .03  .62  .31  .22
Trimethaphan  N  .03 1.05  .73  .60
Trimethaphan  N  .07  .83 1.07  .80
Trimethaphan  N  .09 3.13 2.06 1.23
Trimethaphan  Y  .10  .09  .09  .08
Trimethaphan  Y  .08  .09  .09  .10
Trimethaphan  Y  .13  .10  .12  .12
Trimethaphan  Y  .06  .05  .05  .05
;
proc glm;
   class Drug Depleted;
   model LogHistamine0--LogHistamine5 =
         Drug Depleted Drug*Depleted / nouni;
   repeated Time 4 (0 1 3 5) polynomial / summary printe;
run;

The NOUNI option in the MODEL statement suppresses the individual ANOVA tables for the original dependent variables. These analyses are usually of no interest in a repeated measures analysis. The POLYNOMIAL option in the REPEATED statement indicates that the transformation used to implement the repeated measures analysis is an orthogonal polynomial transformation, and the SUMMARY option requests that the univariate analyses for the orthogonal polynomial contrast variables be displayed. The parenthetical numbers (0 1 3 5) determine the spacing of the orthogonal polynomials used in the analysis.

Output 47.7.1: Summary Information about Groups

The GLM Procedure

Class Level Information
ClassLevelsValues
Drug2Morphine Trimethaphan
Depleted2N Y

Number of Observations Read16
Number of Observations Used15


The "Repeated Measures Level Information" table gives information about the repeated measures effect; it is displayed in Output 47.7.2. In this example, the within-subject (within-dog) effect is Time, which has the levels 0, 1, 3, and 5.

Output 47.7.2: Repeated Measures Levels

The GLM Procedure
Repeated Measures Analysis of Variance

Repeated Measures Level Information
Dependent VariableLogHistamine0LogHistamine1LogHistamine3LogHistamine5
Level of Time0135


The multivariate analyses for within-subject effects and related interactions are displayed in Output 47.7.3. For the example, the first table displayed shows that the TIME effect is significant. In addition, the Time*Drug*Depleted interaction is significant, as shown in the fourth table. This means that the effect of Time on the blood concentration of histamine is different for the four Drug*Depleted combinations studied.

Output 47.7.3: Multivariate Tests of Within-Subject Effects

MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no Time Effect
H = Type III SSCP Matrix for Time
E = Error SSCP Matrix

S=1 M=0.5 N=3.5
StatisticValueF ValueNum DFDen DFPr > F
Wilks' Lambda0.1109770624.03390.0001
Pillai's Trace0.8890229424.03390.0001
Hotelling-Lawley Trace8.0108713724.03390.0001
Roy's Greatest Root8.0108713724.03390.0001

MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no Time*Drug Effect
H = Type III SSCP Matrix for Time*Drug
E = Error SSCP Matrix

S=1 M=0.5 N=3.5
StatisticValueF ValueNum DFDen DFPr > F
Wilks' Lambda0.341559845.78390.0175
Pillai's Trace0.658440165.78390.0175
Hotelling-Lawley Trace1.927744705.78390.0175
Roy's Greatest Root1.927744705.78390.0175

MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no Time*Depleted Effect
H = Type III SSCP Matrix for Time*Depleted
E = Error SSCP Matrix

S=1 M=0.5 N=3.5
StatisticValueF ValueNum DFDen DFPr > F
Wilks' Lambda0.1233998821.31390.0002
Pillai's Trace0.8766001221.31390.0002
Hotelling-Lawley Trace7.1037356721.31390.0002
Roy's Greatest Root7.1037356721.31390.0002

MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no Time*Drug*Depleted Effect
H = Type III SSCP Matrix for Time*Drug*Depleted
E = Error SSCP Matrix

S=1 M=0.5 N=3.5
StatisticValueF ValueNum DFDen DFPr > F
Wilks' Lambda0.1938301012.48390.0015
Pillai's Trace0.8061699012.48390.0015
Hotelling-Lawley Trace4.1591573212.48390.0015
Roy's Greatest Root4.1591573212.48390.0015


Output 47.7.4 displays tests of hypotheses for between-subject (between-dog) effects. This section tests the hypotheses that the different Drugs, Depleteds, and their interactions have no effects on the dependent variables, while ignoring the within-dog effects. From this analysis, there is a significant between-dog effect for Depleted (p-value=0.0229). The interaction and the main effect for Drug are not significant (p-values=0.1734 and 0.1281, respectively).

Output 47.7.4: Tests of Between-Subject Effects

The GLM Procedure
Repeated Measures Analysis of Variance
Tests of Hypotheses for Between Subjects Effects

SourceDFType III SSMean SquareF ValuePr > F
Drug15.993362435.993362432.710.1281
Depleted115.4484070315.448407036.980.0229
Drug*Depleted14.690875084.690875082.120.1734
Error1124.346833482.21334850  


Univariate analyses for within-subject (within-dog) effects and related interactions are displayed in Output 47.7.6. The results for this example are the same as for the multivariate analyses; this is not always the case. In addition, before the univariate analyses are used to make conclusions about the data, the result of the sphericity test (requested with the PRINTE option in the REPEATED statement and displayed in Output 47.7.5) should be examined. If the sphericity test is rejected, consider using the adjusted G-G or H-F-L probabilities. See the section Repeated Measures Analysis of Variance for more information.

Output 47.7.5: Sphericity Test

Sphericity Tests
VariablesDFMauchly's CriterionChi-SquarePr > ChiSq
Transformed Variates50.175264116.9308730.0046
Orthogonal Components50.175264116.9308730.0046


Output 47.7.6: Univariate Tests of Within-Subject Effects

The GLM Procedure
Repeated Measures Analysis of Variance
Univariate Tests of Hypotheses for Within Subject Effects

SourceDFType III SSMean SquareF ValuePr > FAdj Pr > F
G - GH-F-L
Time312.058986774.0196622653.44<.0001<.0001<.0001
Time*Drug31.844295140.614765058.170.00030.00390.0023
Time*Depleted312.089785574.0299285253.57<.0001<.0001<.0001
Time*Drug*Depleted32.930779390.9769264612.99<.00010.00050.0002
Error(Time)332.482388870.07522391    

Greenhouse-Geisser Epsilon0.5694
Huynh-Feldt-Lecoutre Epsilon0.6636


Output 47.7.7 is produced by the SUMMARY option in the REPEATED statement. If the POLYNOMIAL option is not used, a similar table is displayed using the default CONTRAST transformation. The linear, quadratic, and cubic trends for Time, labeled as ‘Time_1’, ‘Time_2’, and ‘Time_3’, are displayed, and in each case, the Source labeled ‘Mean’ gives a test for the respective trend.

Output 47.7.7: Tests of Between-Subject Effects for Transformed Variables

The GLM Procedure
Repeated Measures Analysis of Variance
Analysis of Variance of Contrast Variables
 
Time_N represents the nth degree polynomial contrast for Time


Contrast Variable: Time_1

SourceDFType III SSMean SquareF ValuePr > F
Mean12.009634832.0096348334.990.0001
Drug11.180690761.1806907620.560.0009
Depleted11.361725041.3617250423.710.0005
Drug*Depleted12.043468482.0434684835.58<.0001
Error110.631711610.05742833  


Contrast Variable: Time_2

SourceDFType III SSMean SquareF ValuePr > F
Mean15.409884185.4098841857.15<.0001
Drug10.591731920.591731926.250.0295
Depleted15.949455065.9494550662.86<.0001
Drug*Depleted10.670315870.670315877.080.0221
Error111.041187070.09465337  


Contrast Variable: Time_3

SourceDFType III SSMean SquareF ValuePr > F
Mean14.639467764.6394677663.04<.0001
Drug10.071872460.071872460.980.3443
Depleted14.778605474.7786054764.94<.0001
Drug*Depleted10.216995040.216995042.950.1139
Error110.809490180.07359002