* ch27ta12.sas; * Two-factor experiment with repeated measures on both factors; * Blood flow example, Table 27.12, page 1159; ; options ls=80 nodate; ; data blood; input y subject A B; lines; 2 1 1 1 -1 2 1 1 0 3 1 1 3 4 1 1 1 5 1 1 2 6 1 1 -2 7 1 1 4 8 1 1 -2 9 1 1 -2 10 1 1 2 11 1 1 -1 12 1 1 10 1 1 2 8 2 1 2 11 3 1 2 15 4 1 2 5 5 1 2 12 6 1 2 10 7 1 2 16 8 1 2 7 9 1 2 10 10 1 2 8 11 1 2 8 12 1 2 9 1 2 1 6 2 2 1 8 3 2 1 11 4 2 1 6 5 2 1 9 6 2 1 8 7 2 1 12 8 2 1 7 9 2 1 10 10 2 1 10 11 2 1 6 12 2 1 25 1 2 2 21 2 2 2 24 3 2 2 31 4 2 2 20 5 2 2 27 6 2 2 22 7 2 2 30 8 2 2 24 9 2 2 28 10 2 2 25 11 2 2 23 12 2 2 ; proc plot; plot y*A=B; title 'Two-factor experiment: Repeated measures on both factors.'; title2 'Blood flow example, page 1158, data in Table 27.12.'; ; proc glm; class subject A B; model y = subject | A| B; means A B A*B; random subject A*subject B*subject A*B*subject; test h=A e=A*subject; test h=B e=B*subject; test h=A*B e=A*B*subject; ; proc mixed CL CovTest; class subject A B; model y = A B A*B; random subject A*subject B*subject; * A*B*subject left out, since no replication; lsmeans A B A*B / adjust=Bon CL; Two-factor experiment: Repeated measures on both factors. 1 Blood flow example, page 1158, data in Table 27.12. Plot of y*A. Symbol is value of B. y | | 31 + 2 30 + 2 29 + 28 + 2 27 + 2 26 + 25 + 2 24 + 2 23 + 2 22 + 2 21 + 2 20 + 2 19 + 18 + 17 + 16 + 2 15 + 2 14 + 13 + 12 + 2 1 11 + 2 1 10 + 2 1 9 + 1 8 + 2 1 7 + 2 1 6 + 1 5 + 2 4 + 1 3 + 1 2 + 1 1 + 1 0 + 1 -1 + 1 -2 + 1 | ---+--------------------------------------------------+-- 1 2 A NOTE: 16 obs hidden. Two-factor experiment: Repeated measures on both factors. 2 Blood flow example, page 1158, data in Table 27.12. The GLM Procedure Class Level Information Class Levels Values subject 12 1 2 3 4 5 6 7 8 9 10 11 12 A 2 1 2 B 2 1 2 Number of Observations Read 48 Number of Observations Used 48 Two-factor experiment: Repeated measures on both factors. 3 Blood flow example, page 1158, data in Table 27.12. The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 47 4098.000000 87.191489 . . Error 0 0.000000 . Corrected Total 47 4098.000000 Source DF Type III SS Mean Square F Value Pr > F subject 11 258.500000 23.500000 . . A 1 1587.000000 1587.000000 . . subject*A 11 22.500000 2.045455 . . B 1 2028.000000 2028.000000 . . subject*B 11 42.500000 3.863636 . . A*B 1 147.000000 147.000000 . . subject*A*B 11 12.500000 1.136364 . . Two-factor experiment: Repeated measures on both factors. 4 Blood flow example, page 1158, data in Table 27.12. The GLM Procedure Level of --------------y-------------- A N Mean Std Dev 1 24 5.2500000 5.52661544 2 24 16.7500000 8.86738038 Level of --------------y-------------- B N Mean Std Dev 1 24 4.5000000 4.55879465 2 24 17.5000000 8.31969899 Level of Level of --------------y-------------- A B N Mean Std Dev 1 1 12 0.5000000 2.11057941 1 2 12 10.0000000 3.19089614 2 1 12 8.5000000 2.02259959 2 2 12 25.0000000 3.43775825 Two-factor experiment: Repeated measures on both factors. 5 Blood flow example, page 1158, data in Table 27.12. The GLM Procedure Source Type III Expected Mean Square subject Var(Error) + Var(subject*A*B) + 2 Var(subject*B) + 2 Var(subject*A) + 4 Var(subject) A Var(Error) + Var(subject*A*B) + 2 Var(subject*A) + Q(A,A*B) subject*A Var(Error) + Var(subject*A*B) + 2 Var(subject*A) B Var(Error) + Var(subject*A*B) + 2 Var(subject*B) + Q(B,A*B) subject*B Var(Error) + Var(subject*A*B) + 2 Var(subject*B) A*B Var(Error) + Var(subject*A*B) + Q(A*B) subject*A*B Var(Error) + Var(subject*A*B) Two-factor experiment: Repeated measures on both factors. 6 Blood flow example, page 1158, data in Table 27.12. The GLM Procedure Dependent Variable: y Tests of Hypotheses Using the Type III MS for subject*A as an Error Term Source DF Type III SS Mean Square F Value Pr > F A 1 1587.000000 1587.000000 775.87 <.0001 Tests of Hypotheses Using the Type III MS for subject*B as an Error Term Source DF Type III SS Mean Square F Value Pr > F B 1 2028.000000 2028.000000 524.89 <.0001 Tests of Hypotheses Using the Type III MS for subject*A*B as an Error Term Source DF Type III SS Mean Square F Value Pr > F A*B 1 147.0000000 147.0000000 129.36 <.0001 Two-factor experiment: Repeated measures on both factors. 7 Blood flow example, page 1158, data in Table 27.12. The Mixed Procedure Model Information Data Set WORK.BLOOD Dependent Variable y Covariance Structure Variance Components Estimation Method REML Residual Variance Method Profile Fixed Effects SE Method Model-Based Degrees of Freedom Method Containment Class Level Information Class Levels Values subject 12 1 2 3 4 5 6 7 8 9 10 11 12 A 2 1 2 B 2 1 2 Dimensions Covariance Parameters 4 Columns in X 9 Columns in Z 60 Subjects 1 Max Obs Per Subject 48 Number of Observations Number of Observations Read 48 Number of Observations Used 48 Number of Observations Not Used 0 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 224.25476467 1 1 193.67890648 0.00000000 Convergence criteria met. Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper subject 4.6818 2.5510 1.84 0.0332 0.05 2.0211 20.1303 subject*A 0.4545 0.4989 0.91 0.1811 0.05 0.1136 34.3889 subject*B 1.3636 0.8586 1.59 0.0561 0.05 0.5330 8.1104 Two-factor experiment: Repeated measures on both factors. 8 Blood flow example, page 1158, data in Table 27.12. The Mixed Procedure Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper Residual 1.1364 0.4845 2.35 0.0095 0.05 0.5703 3.2759 Fit Statistics -2 Res Log Likelihood 193.7 AIC (smaller is better) 201.7 AICC (smaller is better) 202.7 BIC (smaller is better) 203.6 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F A 1 11 775.87 <.0001 B 1 11 524.89 <.0001 A*B 1 11 129.36 <.0001 Least Squares Means Standard Effect A B Estimate Error DF t Value Pr > |t| Alpha A 1 5.2500 0.7295 11 7.20 <.0001 0.05 A 2 16.7500 0.7295 11 22.96 <.0001 0.05 B 1 4.5000 0.7550 11 5.96 <.0001 0.05 B 2 17.5000 0.7550 11 23.18 <.0001 0.05 A*B 1 1 0.5000 0.7977 11 0.63 0.5436 0.05 A*B 1 2 10.0000 0.7977 11 12.54 <.0001 0.05 A*B 2 1 8.5000 0.7977 11 10.66 <.0001 0.05 A*B 2 2 25.0000 0.7977 11 31.34 <.0001 0.05 Least Squares Means Effect A B Lower Upper A 1 3.6443 6.8557 A 2 15.1443 18.3557 B 1 2.8382 6.1618 B 2 15.8382 19.1618 A*B 1 1 -1.2558 2.2558 A*B 1 2 8.2442 11.7558 A*B 2 1 6.7442 10.2558 A*B 2 2 23.2442 26.7558 Two-factor experiment: Repeated measures on both factors. 9 Blood flow example, page 1158, data in Table 27.12. The Mixed Procedure Differences of Least Squares Means Standard Effect A B _A _B Estimate Error DF t Value Pr > |t| Adjustment A 1 2 -11.5000 0.4129 11 -27.85 <.0001 Bonferroni B 1 2 -13.0000 0.5674 11 -22.91 <.0001 Bonferroni A*B 1 1 1 2 -9.5000 0.6455 11 -14.72 <.0001 Bonferroni A*B 1 1 2 1 -8.0000 0.5149 11 -15.54 <.0001 Bonferroni A*B 1 1 2 2 -24.5000 0.7017 11 -34.91 <.0001 Bonferroni A*B 1 2 2 1 1.5000 0.7017 11 2.14 0.0558 Bonferroni A*B 1 2 2 2 -15.0000 0.5149 11 -29.13 <.0001 Bonferroni A*B 2 1 2 2 -16.5000 0.6455 11 -25.56 <.0001 Bonferroni Differences of Least Squares Means Adj Adj Effect A B _A _B Adj P Alpha Lower Upper Lower Upper A 1 2 <.0001 0.05 -12.4087 -10.5913 -12.4087 -10.5913 B 1 2 <.0001 0.05 -14.2489 -11.7511 -14.2489 -11.7511 A*B 1 1 1 2 <.0001 0.05 -10.9207 -8.0793 -11.5708 -7.4292 A*B 1 1 2 1 <.0001 0.05 -9.1334 -6.8666 -9.6520 -6.3480 A*B 1 1 2 2 <.0001 0.05 -26.0445 -22.9555 -26.7512 -22.2488 A*B 1 2 2 1 0.3350 0.05 -0.04450 3.0445 -0.7512 3.7512 A*B 1 2 2 2 <.0001 0.05 -16.1334 -13.8666 -16.6520 -13.3480 A*B 2 1 2 2 <.0001 0.05 -17.9207 -15.0793 -18.5708 -14.4292