* ch25ta12.sas, unbalanced 2-factor mixed model; * Sheffield Foods Company example, page 1070 of 5th edition; options ls=78 nodate; ; data milkfat; input fat method lab; lines; 5.19 1 1 1 5.09 1 1 2 4.09 1 2 1 3.99 1 2 2 3.75 1 2 3 4.04 1 2 4 4.06 1 2 5 4.62 1 3 1 4.32 1 3 2 4.35 1 3 3 4.59 1 3 4 3.71 1 4 1 3.86 1 4 2 3.79 1 4 3 3.63 1 4 4 3.26 2 1 1 : : : : 3.04 2 4 4 2.88 2 4 5 3.20 2 4 6 ; proc glm; class method lab; model fat = method | lab; random lab method*lab / test; means method method*lab; * how to estimate variances?; title 'Sheffield Foods Company: data from Table 25.12, page 1071'; ; proc mixed CL CovTest; class method lab; model fat = method; random lab method*lab; lsmeans method / adjust=Tukey CL; ; proc mixed; class method lab; model fat = method; random lab; * fit a reduced model; Sheffield Foods Company: data from Table 25.12, page 1071 1 The GLM Procedure Class Level Information Class Levels Values method 2 1 2 lab 4 1 2 3 4 Number of observations 39 Sheffield Foods Company: data from Table 25.12, page 1071 2 The GLM Procedure Dependent Variable: fat Sum of Source DF Squares Mean Square F Value Pr > F Model 7 15.70729090 2.24389870 97.08 <.0001 Error 31 0.71654500 0.02311435 Corrected Total 38 16.42383590 R-Square Coeff Var Root MSE fat Mean 0.956372 4.342240 0.152034 3.501282 Source DF Type I SS Mean Square F Value Pr > F method 1 12.08240006 12.08240006 522.72 <.0001 lab 3 2.08592577 0.69530859 30.08 <.0001 method*lab 3 1.53896506 0.51298835 22.19 <.0001 Source DF Type III SS Mean Square F Value Pr > F method 1 13.92573335 13.92573335 602.47 <.0001 lab 3 2.96646065 0.98882022 42.78 <.0001 method*lab 3 1.53896506 0.51298835 22.19 <.0001 Sheffield Foods Company: data from Table 25.12, page 1071 3 The GLM Procedure Source Type III Expected Mean Square method Var(Error) + 4.2857 Var(method*lab) + Q(method) lab Var(Error) + 4.452 Var(method*lab) + 8.9039 Var(lab) method*lab Var(Error) + 4.452 Var(method*lab) Sheffield Foods Company: data from Table 25.12, page 1071 4 The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance Dependent Variable: fat Source DF Type III SS Mean Square F Value Pr > F method 1 13.925733 13.925733 28.15 0.0130 Error 3.0105 1.489277 0.494695 Error: 0.9627*MS(method*lab) + 0.0373*MS(Error) Source DF Type III SS Mean Square F Value Pr > F lab 3 2.966461 0.988820 1.93 0.3017 Error 3 1.538965 0.512988 Error: MS(method*lab) Source DF Type III SS Mean Square F Value Pr > F method*lab 3 1.538965 0.512988 22.19 <.0001 Error: MS(Error) 31 0.716545 0.023114 Sheffield Foods Company: data from Table 25.12, page 1071 5 Level of -------------fat------------- method N Mean Std Dev 1 15 4.20533333 0.48475129 2 24 3.06125000 0.21383278 Level of Level of -------------fat------------- method lab N Mean Std Dev 1 1 2 5.14000000 0.07071068 1 2 5 3.98600000 0.13685759 1 3 4 4.47000000 0.15684387 1 4 4 3.74750000 0.09945686 2 1 6 3.29666667 0.15474711 2 2 6 3.07166667 0.17904376 2 3 6 2.92000000 0.16334014 2 4 6 2.95666667 0.15474711 Sheffield Foods Company: data from Table 25.12, page 1071 6 The Mixed Procedure Model Information Data Set WORK.MILKFAT Dependent Variable fat 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 4 1 2 3 4 Dimensions Covariance Parameters 3 Columns in X 3 Columns in Z 12 Subjects 1 Max Obs Per Subject 39 Observations Used 39 Observations Not Used 0 Total Observations 39 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 31.60718255 1 2 -0.65187025 0.07567233 2 1 -4.05286065 0.03827080 3 1 -5.83097144 0.01650009 4 1 -6.59787450 0.00532288 5 1 -6.83833976 0.00101563 6 1 -6.88164672 0.00006735 7 1 -6.88429247 0.00000042 8 1 -6.88430818 0.00000000 Convergence criteria met. Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper lab 0.07347 0.1205 0.61 0.2710 0.05 0.01278 759.48 method*lab 0.1175 0.1008 1.17 0.1219 0.05 0.03623 2.0291 Sheffield Foods Company: data from Table 25.12, page 1071 7 The Mixed Procedure Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper Residual 0.02319 0.005911 3.92 <.0001 0.05 0.01489 0.04108 Fit Statistics -2 Res Log Likelihood -6.9 AIC (smaller is better) -0.9 AICC (smaller is better) -0.2 BIC (smaller is better) -2.7 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F method 1 3 26.16 0.0145 Least Squares Means Standard Effect method Estimate Error DF t Value Pr > |t| Alpha method 1 4.3293 0.2224 3 19.46 0.0003 0.05 method 2 3.0612 0.2207 3 13.87 0.0008 0.05 Least Squares Means Effect method Lower Upper method 1 3.6214 5.0372 method 2 2.3588 3.7637 Differences of Least Squares Means Standard Effect method _method Estimate Error DF t Value Pr > |t| method 1 2 1.2680 0.2479 3 5.11 0.0145 Differences of Least Squares Means Effect method _method Adjustment Adj P Alpha Lower Upper method 1 2 Tukey-Kramer 0.0145 0.05 0.4791 2.0570 Sheffield Foods Company: data from Table 25.12, page 1071 8 method 1 2 0.4791 2.0570 Sheffield Foods Company: data from Table 25.12, page 1071 9 The Mixed Procedure Model Information Data Set WORK.MILKFAT Dependent Variable fat 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 4 1 2 3 4 Dimensions Covariance Parameters 2 Columns in X 3 Columns in Z 4 Subjects 1 Max Obs Per Subject 39 Observations Used 39 Observations Not Used 0 Total Observations 39 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 31.60718255 1 2 17.88936197 0.00071934 2 1 17.86931174 0.00002751 3 1 17.86860350 0.00000005 4 1 17.86860228 0.00000000 Convergence criteria met. Covariance Parameter Estimates Cov Parm Estimate lab 0.07265 Residual 0.06640 Sheffield Foods Company: data from Table 25.12, page 1071 10 (output deleted)