* nesting.sas, data from Table 26.1; * Instructor nested within School; options ls=80 nodate; ; data learning; input y school instr; lines; 25 1 1 1 29 1 1 2 14 1 2 1 11 1 2 2 11 2 1 1 6 2 1 2 22 2 2 1 18 2 2 2 17 3 1 1 20 3 1 2 5 3 2 1 2 3 2 2 ; proc glm; class school instr; model y = school instr(school); random instr(school) / test; means school / Tukey e=instr(school); ; proc mixed CL CovTest; class school instr; model y = school; random instr(school); lsmeans school / adjust=Tukey CL; The SAS System 1 The GLM Procedure Class Level Information Class Levels Values school 3 1 2 3 instr 2 1 2 Number of observations 12 The SAS System 2 The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 5 724.0000000 144.8000000 20.69 0.0010 Error 6 42.0000000 7.0000000 Corrected Total 11 766.0000000 Source DF Type I SS Mean Square F Value Pr > F school 2 156.5000000 78.2500000 11.18 0.0095 instr(school) 3 567.5000000 189.1666667 27.02 0.0007 The SAS System 3 The GLM Procedure Source Type III Expected Mean Square school Var(Error) + 2 Var(instr(school)) + Q(school) instr(school) Var(Error) + 2 Var(instr(school)) The SAS System 4 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 school 2 156.500000 78.250000 0.41 0.6940 Error 3 567.500000 189.166667 Error: MS(instr(school)) Source DF Type III SS Mean Square F Value Pr > F instr(school) 3 567.500000 189.166667 27.02 0.0007 Error: MS(Error) 6 42.000000 7.000000 The SAS System 5 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 3 Error Mean Square 189.1667 Critical Value of Studentized Range 5.90959 Minimum Significant Difference 40.64 Means with the same letter are not significantly different. Tukey Grouping Mean N school A 19.750 4 1 A A 14.250 4 2 A A 11.000 4 3 The SAS System 6 The Mixed Procedure Model Information Data Set WORK.LEARNING 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 school 3 1 2 3 instr 2 1 2 Dimensions Covariance Parameters 2 Columns in X 4 Columns in Z 6 Subjects 1 Max Obs Per Subject 12 Observations Used 12 Observations Not Used 0 Total Observations 12 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 67.63850603 1 1 57.10312296 0.00000000 Convergence criteria met. Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper instr(school) 91.0833 77.2534 1.18 0.1192 0.05 28.3442 1492.44 Residual 7.0000 4.0415 1.73 0.0416 0.05 2.9067 33.9437 Fit Statistics -2 Res Log Likelihood 57.1 AIC (smaller is better) 61.1 AICC (smaller is better) 63.1 The SAS System 7 The Mixed Procedure Fit Statistics BIC (smaller is better) 60.7 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F school 2 3 0.41 0.6940 Least Squares Means Standard Effect school Estimate Error DF t Value Pr > |t| Alpha school 1 19.7500 6.8769 3 2.87 0.0639 0.05 school 2 14.2500 6.8769 3 2.07 0.1300 0.05 school 3 11.0000 6.8769 3 1.60 0.2080 0.05 Least Squares Means Effect school Lower Upper school 1 -2.1353 41.6353 school 2 -7.6353 36.1353 school 3 -10.8853 32.8853 Differences of Least Squares Means Standard Effect school _school Estimate Error DF t Value Pr > |t| school 1 2 5.5000 9.7254 3 0.57 0.6112 school 1 3 8.7500 9.7254 3 0.90 0.4346 Differences of Least Squares Means Effect school _school Adjustment Adj P Alpha Lower Upper school 1 2 Tukey 0.8466 0.05 -25.4506 36.4506 school 1 3 Tukey 0.6771 0.05 -22.2006 39.7006 Differences of Least Squares Means Adj Adj Effect school _school Lower Upper school 1 2 -35.1396 46.1396 school 1 3 -31.8896 49.3896 The SAS System 8 The Mixed Procedure Differences of Least Squares Means Standard Effect school _school Estimate Error DF t Value Pr > |t| school 2 3 3.2500 9.7254 3 0.33 0.7602 Differences of Least Squares Means Effect school _school Adjustment Adj P Alpha Lower Upper school 2 3 Tukey 0.9415 0.05 -27.7006 34.2006 Differences of Least Squares Means Adj Adj Effect school _school Lower Upper school 2 3 -37.3896 43.8896