* ch25pr17.sas, 2-factor mixed model; options ls=78 nodate; ; data A; infile 'ch25pr17.dat'; input y A B; ; proc print; title 'Problem 25.17---Mixed model: A fixed, B random.'; ; * try the OLSE approach; proc glm; class A B; model y = A | B; random B A*B / test; means A / Tukey E=A*B; lsmeans A / adjust=Tukey E=A*B pdiff CL; means A / t E=A*B alpha=0.05; * for HW problem 25.17c; title2 '(SAS uses the unrestricted mixed model.)'; ; * try the ReML approach; proc mixed CL CovTest; * request CLs and tests for variance components; class A B; model y = A; random B A*B; lsmeans A / adjust=Tukey CL; ; * compare proc glm results for additive model with proc mixed results; proc glm; class A B; model y = A B; random B / test; means A / Tukey; Problem 25.17---Mixed model: A fixed, B random. 1 Obs y A B 1 72.0 1 1 2 74.6 1 1 3 67.4 1 1 4 72.8 1 1 5 72.1 1 2 6 76.9 1 2 7 74.8 1 2 8 73.3 1 2 9 75.2 1 3 10 73.8 1 3 11 75.7 1 3 12 77.8 1 3 13 70.4 1 4 14 68.1 1 4 15 72.4 1 4 16 72.4 1 4 17 76.9 2 1 18 78.1 2 1 19 72.9 2 1 20 74.2 2 1 21 80.3 2 2 22 79.3 2 2 23 76.6 2 2 24 77.2 2 2 25 80.2 2 3 26 76.6 2 3 27 77.3 2 3 28 79.9 2 3 29 74.3 2 4 30 77.6 2 4 31 74.4 2 4 32 72.9 2 4 33 76.3 3 1 34 74.1 3 1 35 77.1 3 1 36 75.0 3 1 37 80.9 3 2 38 73.7 3 2 39 78.6 3 2 40 80.2 3 2 41 79.2 3 3 42 78.0 3 3 43 77.6 3 3 44 81.2 3 3 45 71.6 3 4 46 77.7 3 4 47 75.2 3 4 48 74.4 3 4 Problem 25.17---Mixed model: A fixed, B random. 2 (SAS uses the unrestricted mixed model.) The GLM Procedure Class Level Information Class Levels Values A 3 1 2 3 B 4 1 2 3 4 Number of observations 48 Problem 25.17---Mixed model: A fixed, B random. 3 (SAS uses the unrestricted mixed model.) The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 11 305.0916667 27.7356061 5.75 <.0001 Error 36 173.6250000 4.8229167 Corrected Total 47 478.7166667 R-Square Coeff Var Root MSE y Mean 0.637312 2.904593 2.196114 75.60833 Source DF Type I SS Mean Square F Value Pr > F A 2 150.3879167 75.1939583 15.59 <.0001 B 3 152.8516667 50.9505556 10.56 <.0001 A*B 6 1.8520833 0.3086806 0.06 0.9988 Source DF Type III SS Mean Square F Value Pr > F A 2 150.3879167 75.1939583 15.59 <.0001 B 3 152.8516667 50.9505556 10.56 <.0001 A*B 6 1.8520833 0.3086806 0.06 0.9988 Problem 25.17---Mixed model: A fixed, B random. 4 (SAS uses the unrestricted mixed model.) The GLM Procedure Source Type III Expected Mean Square A Var(Error) + 4 Var(A*B) + Q(A) B Var(Error) + 4 Var(A*B) + 12 Var(B) A*B Var(Error) + 4 Var(A*B) Problem 25.17---Mixed model: A fixed, B random. 5 (SAS uses the unrestricted mixed model.) The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance Dependent Variable: y Source DF Type III SS Mean Square F Value Pr > F A 2 150.387917 75.193958 243.60 <.0001 B 3 152.851667 50.950556 165.06 <.0001 Error: MS(A*B) 6 1.852083 0.308681 Source DF Type III SS Mean Square F Value Pr > F A*B 6 1.852083 0.308681 0.06 0.9988 Error: MS(Error) 36 173.625000 4.822917 Problem 25.17---Mixed model: A fixed, B random. 6 (SAS uses the unrestricted mixed model.) Tukey's Studentized Range (HSD) Test for y NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. Alpha 0.05 Error Degrees of Freedom 6 Error Mean Square 0.308681 Critical Value of Studentized Range 4.33902 Minimum Significant Difference 0.6027 Means with the same letter are not significantly different. Tukey Grouping Mean N A A 76.9250 16 3 A A 76.7938 16 2 B 73.1063 16 1 Problem 25.17---Mixed model: A fixed, B random. 7 (SAS uses the unrestricted mixed model.) Least Squares Means Adjustment for Multiple Comparisons: Tukey Standard Errors and Probabilities Calculated Using the Type III MS for A*B as an Error Term LSMEAN A y LSMEAN Number 1 73.1062500 1 2 76.7937500 2 3 76.9250000 3 Least Squares Means for effect A Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: y i/j 1 2 3 1 <.0001 <.0001 2 <.0001 0.7895 3 <.0001 0.7895 A y LSMEAN 95% Confidence Limits 1 73.106250 72.766380 73.446120 2 76.793750 76.453880 77.133620 3 76.925000 76.585130 77.264870 Least Squares Means for Effect A Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 -3.687500 -4.290179 -3.084821 1 3 -3.818750 -4.421429 -3.216071 2 3 -0.131250 -0.733929 0.471429 Problem 25.17---Mixed model: A fixed, B random. 8 (SAS uses the unrestricted mixed model.) t Tests (LSD) for y NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 6 Error Mean Square 0.308681 Critical Value of t 2.44691 Least Significant Difference 0.4806 Means with the same letter are not significantly different. t Grouping Mean N A A 76.9250 16 3 A A 76.7938 16 2 B 73.1063 16 1 Problem 25.17---Mixed model: A fixed, B random. 9 (SAS uses the unrestricted mixed model.) The Mixed Procedure Model Information Data Set WORK.A 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 A 3 1 2 3 B 4 1 2 3 4 Dimensions Covariance Parameters 3 Columns in X 4 Columns in Z 16 Subjects 1 Max Obs Per Subject 48 Observations Used 48 Observations Not Used 0 Total Observations 48 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 225.45311480 1 2 207.86808217 0.00000079 2 1 207.86803230 0.00000000 Convergence criteria met. Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper B 3.8974 3.4671 1.12 0.1305 0.05 1.1662 79.9550 A*B 0 . . . . . . Residual 4.1780 0.9117 4.58 <.0001 0.05 2.8405 6.7495 Problem 25.17---Mixed model: A fixed, B random. 10 (SAS uses the unrestricted mixed model.) The Mixed Procedure Fit Statistics -2 Res Log Likelihood 207.9 AIC (smaller is better) 211.9 AICC (smaller is better) 212.2 BIC (smaller is better) 210.6 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F A 2 6 18.00 0.0029 Least Squares Means Standard Effect A Estimate Error DF t Value Pr > |t| Alpha A 1 73.1062 1.1115 6 65.77 <.0001 0.05 A 2 76.7937 1.1115 6 69.09 <.0001 0.05 A 3 76.9250 1.1115 6 69.21 <.0001 0.05 Least Squares Means Effect A Lower Upper A 1 70.3864 75.8261 A 2 74.0739 79.5136 A 3 74.2052 79.6448 Differences of Least Squares Means Standard Effect A _A Estimate Error DF t Value Pr > |t| Adjustment A 1 2 -3.6875 0.7227 6 -5.10 0.0022 Tukey-Kramer A 1 3 -3.8187 0.7227 6 -5.28 0.0019 Tukey-Kramer A 2 3 -0.1312 0.7227 6 -0.18 0.8619 Tukey-Kramer Differences of Least Squares Means Adj Adj Effect A _A Adj P Alpha Lower Upper Lower Upper A 1 2 0.0053 0.05 -5.4558 -1.9192 -5.9048 -1.4702 A 1 3 0.0045 0.05 -5.5871 -2.0504 -6.0360 -1.6015 A 2 3 0.9820 0.05 -1.8996 1.6371 -2.3485 2.0860 Problem 25.17---Mixed model: A fixed, B random. 11 (SAS uses the unrestricted mixed model.) The GLM Procedure Class Level Information Class Levels Values A 3 1 2 3 B 4 1 2 3 4 Number of observations 48 Problem 25.17---Mixed model: A fixed, B random. 12 (SAS uses the unrestricted mixed model.) The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 5 303.2395833 60.6479167 14.52 <.0001 Error 42 175.4770833 4.1780258 Corrected Total 47 478.7166667 R-Square Coeff Var Root MSE y Mean 0.633443 2.703435 2.044022 75.60833 Source DF Type I SS Mean Square F Value Pr > F A 2 150.3879167 75.1939583 18.00 <.0001 B 3 152.8516667 50.9505556 12.19 <.0001 Source DF Type III SS Mean Square F Value Pr > F A 2 150.3879167 75.1939583 18.00 <.0001 B 3 152.8516667 50.9505556 12.19 <.0001 Problem 25.17---Mixed model: A fixed, B random. 13 (SAS uses the unrestricted mixed model.) The GLM Procedure Source Type III Expected Mean Square A Var(Error) + Q(A) B Var(Error) + 12 Var(B) Problem 25.17---Mixed model: A fixed, B random. 14 (SAS uses the unrestricted mixed model.) The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance Dependent Variable: y Source DF Type III SS Mean Square F Value Pr > F A 2 150.387917 75.193958 18.00 <.0001 B 3 152.851667 50.950556 12.19 <.0001 Error: MS(Error) 42 175.477083 4.178026 Problem 25.17---Mixed model: A fixed, B random. 15 (SAS uses the unrestricted mixed model.) Tukey's Studentized Range (HSD) Test for y NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. Alpha 0.05 Error Degrees of Freedom 42 Error Mean Square 4.178026 Critical Value of Studentized Range 3.43582 Minimum Significant Difference 1.7557 Means with the same letter are not significantly different. Tukey Grouping Mean N A A 76.9250 16 3 A A 76.7938 16 2 B 73.1063 16 1