* midterm06.sas; * A sample STT 647 midterm exam question, winter 2006; options ls=76 nodate; ; data coal; do method=1 to 2; do rep=1 to 2; do lab=1 to 7; input y @@; output; end; end; end; lines; .107 .127 .115 .108 .097 .114 .155 .105 .122 .112 .108 .096 .119 .145 .105 .127 .109 .117 .110 .116 .164 .103 .124 .111 .115 .097 .122 .160 ; proc print; ; proc glm; class method lab; model y = method | lab; random lab lab*method; means method; ; proc mixed CL CovTest; class method lab; model y = method; random lab lab*method; lsmeans method / pdiff CL; The SAS System 1 Obs method rep lab y 1 1 1 1 0.107 2 1 1 2 0.127 3 1 1 3 0.115 4 1 1 4 0.108 5 1 1 5 0.097 6 1 1 6 0.114 7 1 1 7 0.155 8 1 2 1 0.105 9 1 2 2 0.122 10 1 2 3 0.112 11 1 2 4 0.108 12 1 2 5 0.096 13 1 2 6 0.119 14 1 2 7 0.145 15 2 1 1 0.105 16 2 1 2 0.127 17 2 1 3 0.109 18 2 1 4 0.117 19 2 1 5 0.110 20 2 1 6 0.116 21 2 1 7 0.164 22 2 2 1 0.103 23 2 2 2 0.124 24 2 2 3 0.111 25 2 2 4 0.115 26 2 2 5 0.097 27 2 2 6 0.122 28 2 2 7 0.160 The SAS System 2 The GLM Procedure Class Level Information Class Levels Values method 2 1 2 lab 7 1 2 3 4 5 6 7 Number of Observations Read 28 Number of Observations Used 28 The SAS System 3 The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 13 0.00852371 0.00065567 45.22 <.0001 Error 14 0.00020300 0.00001450 Corrected Total 27 0.00872671 R-Square Coeff Var Root MSE y Mean 0.976738 3.221173 0.003808 0.118214 Source DF Type I SS Mean Square F Value Pr > F method 1 0.00008929 0.00008929 6.16 0.0264 lab 6 0.00824321 0.00137387 94.75 <.0001 method*lab 6 0.00019121 0.00003187 2.20 0.1055 Source DF Type III SS Mean Square F Value Pr > F method 1 0.00008929 0.00008929 6.16 0.0264 lab 6 0.00824321 0.00137387 94.75 <.0001 method*lab 6 0.00019121 0.00003187 2.20 0.1055 The SAS System 4 The GLM Procedure Source Type III Expected Mean Square method Var(Error) + 2 Var(method*lab) + Q(method) lab Var(Error) + 2 Var(method*lab) + 4 Var(lab) method*lab Var(Error) + 2 Var(method*lab) The SAS System 5 The GLM Procedure Level of --------------y-------------- method N Mean Std Dev 1 14 0.11642857 0.01672729 2 14 0.12000000 0.01961161 The SAS System 6 The Mixed Procedure Model Information Data Set WORK.COAL 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 method 2 1 2 lab 7 1 2 3 4 5 6 7 Dimensions Covariance Parameters 3 Columns in X 3 Columns in Z 21 Subjects 1 Max Obs Per Subject 28 Number of Observations Number of Observations Read 28 Number of Observations Used 28 Number of Observations Not Used 0 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 -129.19050095 1 1 -178.58014660 0.00000000 Convergence criteria met. Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower lab 0.000335 0.000198 1.69 0.0454 0.05 0.000137 method*lab 8.685E-6 9.599E-6 0.90 0.1828 0.05 2.158E-6 Residual 0.000014 5.48E-6 2.65 0.0041 0.05 7.772E-6 The SAS System 7 The Mixed Procedure Covariance Parameter Estimates Cov Parm Upper lab 0.001715 method*lab 0.000694 Residual 0.000036 Fit Statistics -2 Res Log Likelihood -178.6 AIC (smaller is better) -172.6 AICC (smaller is better) -171.5 BIC (smaller is better) -172.7 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F method 1 6 2.80 0.1452 Least Squares Means Standard Effect method Estimate Error DF t Value Pr > |t| Alpha method 1 0.1164 0.007086 6 16.43 <.0001 0.05 method 2 0.1200 0.007086 6 16.94 <.0001 0.05 Least Squares Means Effect method Lower Upper method 1 0.09909 0.1338 method 2 0.1027 0.1373 Differences of Least Squares Means Standard Effect method _method Estimate Error DF t Value Pr > |t| Alpha method 1 2 -0.00357 0.002134 6 -1.67 0.1452 0.05 Differences of Least Squares Means Effect method _method Lower Upper method 1 2 -0.00879 0.001650