Solution file for additional exercise 10.6 ------------------------------------------ Data on ratings of machines operated by different persons. The data are unbalanced because the machines are operated different number of times by the different persons. - notation: y_ijk = rating for replication k of machine i by person j, i = 1,2,3 (machines), j = 1,...,6 (person), k = 1,...,n_ij (replication; n_ij's are either 1, 2 or 3), - the effect of machines is fixed (the 3 machines are of specific interest), - the effect of persons should probably be taken as random because we have no interest in the particular persons but in the general variability between persons, persons correspond to blocks, (one may also take persons as fixed) - the effect of machines*persons should be taken as random (our interest is in general differences between machines, not differences for specific persons), no matter whether persons are taken as fixed or random, - model: y_ijk = mu + alpha_i + B_j + (AB)_ij + eps_ijk, where B_j's are assumed i.i.d. N(0,sigma_A^2), where AB_ij's are assumed i.i.d. N(0,sigma_AB^2), and where eps_ijk's are assumed i.i.d. N(0,sigma^2). - type of analysis: two-way ANOVA with mixed effects (both fixed and random), MTB > WOpen "h:\vhm\vhm802\data_csv\hs10_6.csv"; SUBC> FType; SUBC> CSV; SUBC> DecSep; SUBC> Period; SUBC> Field; SUBC> Comma; SUBC> TDelimiter; SUBC> DoubleQuote. Retrieving worksheet from file: 'h:\vhm\vhm802\data_csv\hs10_6.csv' Worksheet was saved on 03/03/2011 MTB > Name c4 "RESI1" c5 "SRES1" c6 "TRES1" MTB > GLM 'rating' = machine| person; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS; SUBC> Means machine; SUBC> Residuals 'RESI1'; SUBC> SResiduals 'SRES1'; SUBC> TResiduals 'TRES1'; SUBC> GFourpack; SUBC> RType 2 . General Linear Model: rating versus machine, person Factor Type Levels Values machine fixed 3 1, 2, 3 person random 6 1, 2, 3, 4, 5, 6 Analysis of Variance for rating, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P machine 2 1648.66 1238.20 619.10 16.57 0.001 x person 5 1008.76 1011.05 202.21 5.17 0.013 x machine*person 10 404.32 404.32 40.43 46.34 0.000 Error 26 22.69 22.69 0.87 Total 43 3084.43 x Not an exact F-test. S = 0.934111 R-Sq = 99.26% R-Sq(adj) = 98.78% Unusual Observations for rating Obs rating Fit SE Fit Residual St Resid 1 52.0000 52.0000 0.9341 -0.0000 * X 3 60.0000 60.0000 0.9341 0.0000 * X 7 64.0000 64.0000 0.9341 -0.0000 * X 9 68.6000 67.2000 0.6605 1.4000 2.12 R 22 44.8000 46.8000 0.5393 -2.0000 -2.62 R 24 65.8000 67.2000 0.6605 -1.4000 -2.12 R 35 49.2000 46.8000 0.5393 2.4000 3.15 R R denotes an observation with a large standardized residual. X denotes an observation whose X value gives it large influence. Expected Mean Squares, using Adjusted SS Source Expected Mean Square for Each Term 1 machine (4) + 2.1370 (3) + Q[1] 2 person (4) + 2.2408 (3) + 6.7224 (2) 3 machine*person (4) + 2.3162 (3) 4 Error (4) ... Variance Components, using Adjusted SS Estimated Source Value person 24.2571 machine*person 17.0791 Error 0.8726 Least Squares Means for rating machine Mean 1 52.36 2 60.34 3 66.27 Residual Plots for rating MTB > GLM 'rating' = machine| person; SUBC> Random 'person'; SUBC> SMeans C4000; SUBC> Brief 0; SUBC> Interact 'machine' 'person'. MTB > GFInt 'machine' 'person'; SUBC> Responses 'rating'; SUBC> FMeans C4000. Interaction Plot (fitted means) for rating MTB > Erase C4000. MTB > NormTest 'SRES1'. Probability Plot of SRES1 The P-value for the Anderson-Darling test of normality is 0.054. MTB > Name c7 "ByVar1" c8 "ByVar2" c9 "Mean1" MTB > Statistics 'rating'; SUBC> By 'machine' 'person'; SUBC> GValues 'ByVar1'-'ByVar2'; SUBC> Mean 'Mean1'. MTB > Name c10 "RESI2" MTB > Twoway 'Mean1' 'ByVar1' 'ByVar2'; SUBC> Residuals 'RESI2'; SUBC> Means 'ByVar1' 'ByVar2'. Two-way ANOVA: Mean1 versus ByVar1, ByVar2 Source DF SS MS F P ByVar1 2 584.74 292.368 20.16 0.000 ByVar2 5 410.41 82.082 5.66 0.010 Error 10 144.99 14.499 Total 17 1140.14 S = 3.808 R-Sq = 87.28% R-Sq(adj) = 78.38% Individual 95% CIs For Mean Based on Pooled StDev ByVar1 Mean ---------+---------+---------+---------+ 1 52.3611 (-----*-----) 2 60.3389 (-----*----) 3 66.2722 (----*-----) ---------+---------+---------+---------+ 54.0 60.0 66.0 72.0 Individual 95% CIs For Mean Based on Pooled StDev ByVar2 Mean -----+---------+---------+---------+---- 1 61.0667 (------*------) 2 57.9000 (------*------) 3 66.0000 (------*------) 4 59.7333 (------*------) 5 62.6667 (------*------) 6 50.5778 (------*------) -----+---------+---------+---------+---- 49.0 56.0 63.0 70.0 MTB > NormTest 'RESI2'. Probability Plot of RESI2 The P-value for the Anderson-Darling test of normality is 0.353. MTB > Name c11 "ByVar3" c12 "Mean3" MTB > Statistics 'rating'; SUBC> By 'person'; SUBC> GValues 'ByVar3'; SUBC> Mean 'Mean3'. MTB > NormTest 'Mean3'. Probability Plot of Mean3 The P-value for the Anderson-Darling test of normality is 0.531. Comments and answers to questions: ---------------------------------- The residuals look a bit strange because of 5 scattered residuals with values that are somewhat more extreme than all the other residuals. The two values for machine 2 and employee 3 don't agree well, and there is also substantial disagreement between the three values of employee 6 at machine 1. However, the residuals are not very large, and there would not seem to be any reason to exclude them. One would be advised to look at the experimental protocols to see if some errors had occurred. Some observations do not have standardised residuals, because there was no replication at the corresponding person*machine level; it's not an error or a serious problem. The analysis of machine*person means did not show any problems with residuals. Note that a likelihood-based analysis identifies an extreme (small) residual for person=6 and machine=2. The residual is also low in the analysis based on the means, but not as extreme as in the likelihood- based analysis. It could be suggested to inspect the circumstances of this particular set of values (which are pretty consistent). Also generally, person 6 is somewhat lower than the others, and one might consider omitting him from the sample due to the extreme variations across machines. The overall value for person 6 is not beyond what could be expected from a normal distribution sample. The estimated variance components are given above. There is a strong effect of machines (P=0.001 with the approximate test of the ANOVA table), and the least squares means show machine 3 to perform best and machine 1 to perform worst. The interaction plot shows roughly parallel curves, except that machine 2 performs very poorly with employee 6. No standard errors are given for the least squares means, and Minitab will not perform any pairwise comparisons. As judged from the means and the strong significance of machines, one would guess all machines to be statistically different. A likelihood-based analysis (xtmixed in Stata or proc mixed in SAS) gives the correct standard errors and provides pairwise comparisons.