Data from Table 17.2, page 387
data table17_2; input s a p y; datalines; 1 1 1 8 1 2 2 12 1 3 3 9 2 2 1 13 2 3 2 14 2 1 3 8 3 3 1 6 3 1 2 9 3 2 3 15 4 1 1 0 4 3 2 12 4 2 3 18 5 2 1 14 5 1 2 13 5 3 3 19 6 3 1 7 6 2 2 18 6 1 3 12 ; run;
Table 17.2, page 387. The analysis of a within-subject design, accounting for the counterbalanced factor, using proc glm
proc glm data = table17_2; class a p s; model y = a p s/ss3; run; quit;
The GLM Procedure
Class Level Information
Class Levels Values
a 3 1 2 3
p 3 1 2 3
s 6 1 2 3 4 5 6
Number of observations 18
Dependent Variable: y
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 9 315.1666667 35.0185185 3.72 0.0390
Error 8 75.3333333 9.4166667
Corrected Total 17 390.5000000
R-Square Coeff Var Root MSE y Mean
0.807085 26.68399 3.068659 11.50000
Source DF Type III SS Mean Square F Value Pr > F
a 2 134.3333333 67.1666667 7.13 0.0167
p 2 111.0000000 55.5000000 5.89 0.0267
s 5 69.8333333 13.9666667 1.48 0.2950
The same analysis using proc mixed.
proc mixed data = table17_2; class a p s; model y = a p; repeated/ subject = s type = cs; run; quit;
The Mixed Procedure
Model Information
Data Set WORK.TABLE17_2
Dependent Variable y
Covariance Structure Compound Symmetry
Subject Effect s
Estimation Method REML
Residual Variance Method Profile
Fixed Effects SE Method Model-Based
Degrees of Freedom Method Between-Within
Class Level Information
Class Levels Values
a 3 1 2 3
p 3 1 2 3
s 6 1 2 3 4 5 6
Dimensions
Covariance Parameters 2
Columns in X 7
Columns in Z 0
Subjects 6
Max Obs Per Subject 3
Observations Used 18
Observations Not Used 0
Total Observations 18
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
0 1 76.12071787
1 1 75.87580396 0.00000000
Convergence criteria met.
Covariance Parameter Estimates
Cov Parm Subject Estimate
CS s 1.5167
Residual 9.4167
Fit Statistics
-2 Res Log Likelihood 75.9
AIC (smaller is better) 79.9
AICC (smaller is better) 81.1
BIC (smaller is better) 79.5
Null Model Likelihood Ratio Test
DF Chi-Square Pr > ChiSq
1 0.24 0.6207
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
a 2 8 7.13 0.0167
p 2 8 5.89 0.0267
