Solution file for additional exercise 10.9 ------------------------------------------ Data on visual acuity (response time to see a flash light) which was measured for the left and right eye of 7 persons, and with 4 different lenses of different powers placed before the eyes. - notation: y_ijk = response time for person i and eye j with lens of power k, i = 1,2,3,4,5,6,7 (persons), j = 1,2 (side: left, right), k = 1,2,3,4 (powers: 6/6, 6/18, 6/36, 6/60), - repeated measures data with 4 measurements on each eye (order unknown), - may be viewed as a split-plot design with * eyes = whole plots, * side = whole plot factor, * measurements = subplots, * power = subplot factor, * persons = blocks, - model: y_ijk = mu + A_i + beta_j + (AB)_ij + gamma_k + (alpha gamma)_jk + eps_ijk, where A_I's are assumed i.i.d. N(0,sigma^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), we take here person effects as random because there could be some interest in a variation between persons. MTB > WOpen "h:\vhm\vhm802\data_csv\hs10_9.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_9.csv' Worksheet was saved on 03/03/2011 MTB > Name c5 "SRES1" c6 "TRES1" MTB > GLM 'acuity' = eye| power person person* eye; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS; SUBC> Means eye|power; SUBC> SResiduals 'SRES1'; SUBC> TResiduals 'TRES1'; SUBC> GFourpack; SUBC> RType 2 . General Linear Model: acuity versus eye, power, person Factor Type Levels Values eye fixed 2 left, right power fixed 4 6|6, 6|18, 6|36, 6|60 person random 7 1, 2, 3, 4, 5, 6, 7 Analysis of Variance for acuity, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P eye 1 46.45 46.45 46.45 0.78 0.411 power 3 140.77 140.77 46.92 2.78 0.055 eye*power 3 40.62 40.62 13.54 0.80 0.500 person 6 1379.43 1379.43 229.90 3.86 0.062 eye*person 6 357.43 357.43 59.57 3.53 0.007 Error 36 606.86 606.86 16.86 Total 55 2571.55 S = 4.10575 R-Sq = 76.40% R-Sq(adj) = 63.95% Unusual Observations for acuity Obs acuity Fit SE Fit Residual St Resid 41 119.000 110.536 2.454 8.464 2.57 R 43 94.000 107.821 2.454 -13.821 -4.20 R R denotes an observation with a large standardized residual. Expected Mean Squares, using Adjusted SS Source Expected Mean Square for Each Term 1 eye (6) + 4.0000 (5) + Q[1, 3] 2 power (6) + Q[2, 3] 3 eye*power (6) + Q[3] 4 person (6) + 4.0000 (5) + 8.0000 (4) 5 eye*person (6) + 4.0000 (5) 6 Error (6) ... Variance Components, using Adjusted SS Estimated Source Value person 21.29 eye*person 10.68 Error 16.86 Least Squares Means for acuity eye Mean left 114.3 right 112.5 power 6|6 112.6 6|18 113.4 6|36 111.6 6|60 115.9 eye*power left 6|6 113.9 left 6|18 114.6 left 6|36 111.1 left 6|60 117.7 right 6|6 111.4 right 6|18 112.3 right 6|36 112.1 right 6|60 114.1 Residual Plots for acuity MTB > GLM 'acuity' = eye| power person person* eye; SUBC> Random 'person'; SUBC> SMeans C4000; SUBC> Brief 0; SUBC> Interact 'eye' 'power'. MTB > GFInt 'eye' 'power'; SUBC> Responses 'acuity'; SUBC> FMeans C4000. Interaction Plot (fitted means) for acuity MTB > Erase C4000. Comments: --------- The analysis shows a reasonably good looking residual plot, except for one extreme outlier: patient 6, left eye, power 6/36. This value clearly sticks out as different by just looking at the data, and the standardized and deletion residuals are -4.20 and -5.80, respectively. The P-value for the usual outlier test is therefore: P=2*P(t(35)<-5.80)*56 = 0.0001. We decide to remove this value. MTB > copy c4 c7 MTB > name c7 'acuity-1' MTB > let c7(43)='*' MTB > Name c8 "SRES2" c9 "TRES2" MTB > GLM 'acuity-1' = eye| power person person* eye; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS; SUBC> Means eye|power; SUBC> SResiduals 'SRES2'; SUBC> TResiduals 'TRES2'; SUBC> GFourpack; SUBC> RType 2 . General Linear Model: acuity-1 versus eye, power, person Factor Type Levels Values eye fixed 2 left, right power fixed 4 6|6, 6|18, 6|36, 6|60 person random 7 1, 2, 3, 4, 5, 6, 7 Analysis of Variance for acuity-1, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P eye 1 91.075 91.325 91.325 0.96 0.364 x power 3 90.496 88.968 29.656 3.35 0.030 eye*power 3 5.499 4.631 1.544 0.17 0.913 person 6 1121.524 972.351 162.058 1.71 0.266 eye*person 6 569.636 569.636 94.939 10.73 0.000 Error 35 309.696 309.696 8.848 Total 54 2187.927 x Not an exact F-test. S = 2.97464 R-Sq = 85.85% R-Sq(adj) = 78.16% Unusual Observations for acuity-1 Obs acuity-1 Fit SE Fit Residual St Resid 51 105.000 109.875 1.822 -4.875 -2.07 R 54 105.000 109.786 1.778 -4.786 -2.01 R 55 115.000 109.643 1.778 5.357 2.25 R R denotes an observation with a large standardized residual. Expected Mean Squares, using Adjusted SS Source Expected Mean Square for Each Term 1 eye (6) + 3.8919 (5) + Q[1, 3] 2 power (6) + Q[2, 3] 3 eye*power (6) + Q[3] 4 person (6) + 3.9048 (5) + 7.8095 (4) 5 eye*person (6) + 3.9048 (5) 6 Error (6) ... Variance Components, using Adjusted SS Estimated Source Value person 8.595 eye*person 22.048 Error 8.848 Least Squares Means for acuity-1 eye Mean left 115.1 right 112.5 power 6|6 112.6 6|18 113.4 6|36 113.2 6|60 115.9 eye*power left 6|6 113.9 left 6|18 114.6 left 6|36 114.2 left 6|60 117.7 right 6|6 111.4 right 6|18 112.3 right 6|36 112.1 right 6|60 114.1 Residual Plots for acuity-1 MTB > GLM 'acuity-1' = eye| power person person* eye; SUBC> Random 'person'; SUBC> SMeans C4000; SUBC> Brief 0; SUBC> Interact 'eye' 'power'. MTB > GFInt 'eye' 'power'; SUBC> Responses 'acuity-1'; SUBC> FMeans C4000. Interaction Plot (fitted means) for acuity-1 MTB > Erase C4000. Comments: --------- The changes in the ANOVA table and the estimated variance components are substantial. The distribution of variance on the three random effects is shifted completely, and not surprisingly has the error variance gone down to about half of its previous value. The R^2 has increased from 76% to 86%. The interaction of the reduced dataset shows almost completely parallel curves, but in the original analysis there was a clear deviation from parallel curves for eye=left and power=6|36. The design without this one value becomes unbalanced, and the ANOVA-based methods only gives approximate inference for testing the eye effect. In practice, this small deviation from a balanced design is not critical. The ANOVA table shows only a significant effect of power, and it is rather weak with P=0.03. The estimated variance components show the variation between eyes to be of major importance. The residuals look nice. The least squares means for the 4 powers indicate 6/60 to give higher response times than the others. We create the corresponding contrast, and compute its sum of squares. As a first step, we remove the non-significant interaction term power*eye (because the design is unbalanced). MTB > GLM 'acuity-1' = eye power person person* eye; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS; SUBC> Means eye power. General Linear Model: acuity-1 versus eye, power, person Factor Type Levels Values eye fixed 2 left, right power fixed 4 6|6, 6|18, 6|36, 6|60 person random 7 1, 2, 3, 4, 5, 6, 7 Analysis of Variance for acuity-1, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P eye 1 91.08 92.46 92.46 0.96 0.366 x power 3 90.50 88.59 29.53 3.57 0.023 person 6 1111.24 972.12 162.02 1.67 0.274 eye*person 6 580.79 580.79 96.80 11.70 0.000 Error 38 314.33 314.33 8.27 Total 54 2187.93 x Not an exact F-test. S = 2.87607 R-Sq = 85.63% R-Sq(adj) = 79.58% Unusual Observations for acuity-1 Obs acuity-1 Fit SE Fit Residual St Resid 40 112.000 116.877 1.586 -4.877 -2.03 R 51 105.000 110.154 1.595 -5.154 -2.15 R 52 118.000 112.877 1.586 5.123 2.14 R 55 115.000 109.404 1.595 5.596 2.34 R R denotes an observation with a large standardized residual. Expected Mean Squares, using Adjusted SS Source Expected Mean Square for Each Term 1 eye (5) + 3.9000 (4) + Q[1] 2 power (5) + Q[2] 3 person (5) + 3.9111 (4) + 7.8222 (3) 4 eye*person (5) + 3.9111 (4) 5 Error (5) ... Variance Components, using Adjusted SS Estimated Source Value person 8.338 eye*person 22.635 Error 8.272 Least Squares Means for acuity-1 eye Mean left 115.1 right 112.5 power 6|6 112.6 6|18 113.4 6|36 113.2 6|60 115.9 MTB > Name c10 "powercon" MTB > Code ( "6|6" "6|18" "6|36" ) -1 ( "6|60" ) 1 'power' 'powercon' MTB > GLM 'acuity-1' = eye powercon person person* eye; SUBC> Covariates 'powercon'; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS. General Linear Model: acuity-1 versus eye, person Factor Type Levels Values eye fixed 2 left, right person random 7 1, 2, 3, 4, 5, 6, 7 Analysis of Variance for acuity-1, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P eye 1 91.08 92.22 92.22 0.95 0.367 x powercon 1 86.14 84.02 84.02 10.54 0.002 person 6 1108.53 977.17 162.86 1.68 0.273 eye*person 6 583.28 583.28 97.21 12.19 0.000 Error 40 318.90 318.90 7.97 Total 54 2187.93 x Not an exact F-test. S = 2.82356 R-Sq = 85.42% R-Sq(adj) = 80.32% Term Coef SE Coef T P Constant 114.509 0.437 261.78 0.000 powercon 1.4200 0.4374 3.25 0.002 Unusual Observations for acuity-1 Obs acuity-1 Fit SE Fit Residual St Resid 40 112.000 116.880 1.557 -4.880 -2.07 R 51 105.000 110.040 1.429 -5.040 -2.07 R 52 118.000 112.880 1.557 5.120 2.17 R 55 115.000 109.290 1.429 5.710 2.34 R R denotes an observation with a large standardized residual. Expected Mean Squares, using Adjusted SS Source Expected Mean Square for Each Term 1 eye (5) + 3.9062 (4) + Q[1] 2 powercon (5) + Q[2] 3 person (5) + 3.9161 (4) + 7.8322 (3) 4 eye*person (5) + 3.9161 (4) 5 Error (5) ... Variance Components, using Adjusted SS Estimated Source Value person 8.382 eye*person 22.788 Error 7.973 Comments: -------- The two models cannot be tested against each other with an exact F-test (because of the unbalanced design and the random effects). However, an approximate test would use the usual formula based on error SS and DF (because power is the sub-plot factor), and would give an F-value less than 1. It is also seen that the contrast accounts for 84.02/88.59=95% of the variation between powers. The significance for the contrast in the ANOVA table is way too strong, unless the contrast was preplanned (because it was suggested by the data). We cannot use Scheffe's procedure here (because of the unbalancedness and the random effects), so it's not obvious how to get an "honest" significance for the contrast. Additional note: ---------------- Crowder & Hand (1990): Analysis of Repeated Measures, give a different analysis of these data. First, it is not analyzed as a split-plot design but by a random effects model with an additional person*power random effect. This leads to a different ANOVA table and changes the residuals of the model, so that obs. 43 has no longer an extreme residual. Therefore, a different analysis results, and in this analysis there is NO effect of power (or of anything else). One may ask which analysis is then the correct one. A residual analysis of the estimated variance components using proc Mixed in SAS shows that there are now 3 sets of moderately extreme residuals for obs. 43: for error residual, for person*eye and for person*power. To keep this observation in the model still seems questionable, but it has become more difficult to detect. If this observation is removed, the F-test for power become F=3.40 with a P-value of 0.039. Therefore, it seems that the conclusion of the split-plot model holds also for the more elaborate model in Crowder & Hand, but that the conclusion (both our and theirs) hinge on a single observation. Below the Minitab analyses with ANOVA tables for the model with an additional random effect of person*power, both when excluding and including obs. 43. Note also the considerable differences in the estimates for the variance components. MTB > GLM 'acuity' = eye|power person person* eye person*power; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS; SUBC> SResiduals 'SRES3'; SUBC> TResiduals 'TRES3'. General Linear Model: acuity versus eye, power, person Factor Type Levels Values eye fixed 2 left, right power fixed 4 6|6, 6|18, 6|36, 6|60 person random 7 1, 2, 3, 4, 5, 6, 7 Analysis of Variance for acuity, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P eye 1 46.45 46.45 46.45 0.78 0.411 power 3 140.77 140.77 46.92 2.25 0.118 eye*power 3 40.62 40.62 13.54 1.06 0.393 person 6 1379.43 1379.43 229.90 3.40 0.064 x eye*person 6 357.43 357.43 59.57 4.64 0.005 power*person 18 375.86 375.86 20.88 1.63 0.155 Error 18 231.00 231.00 12.83 Total 55 2571.55 x Not an exact F-test. S = 3.58236 R-Sq = 91.02% R-Sq(adj) = 72.55% Unusual Observations for acuity Obs acuity Fit SE Fit Residual St Resid 43 94.000 99.339 2.951 -5.339 -2.63 R 47 94.000 88.661 2.951 5.339 2.63 R R denotes an observation with a large standardized residual. Expected Mean Squares, using Adjusted SS Source Expected Mean Square for Each Term 1 eye (7) + 4.0000 (5) + Q[1, 3] 2 power (7) + 2.0000 (6) + Q[2, 3] 3 eye*power (7) + Q[3] 4 person (7) + 2.0000 (6) + 4.0000 (5) + 8.0000 (4) 5 eye*person (7) + 4.0000 (5) 6 power*person (7) + 2.0000 (6) 7 Error (7) ... Variance Components, using Adjusted SS Estimated Source Value person 20.286 eye*person 11.685 power*person 4.024 Error 12.833 MTB > Name c13 "SRES4" c14 "TRES4" MTB > GLM 'acuity-1' = eye|power person person* eye person*power; SUBC> Random 'person'; SUBC> Brief 2 ; SUBC> EMS; SUBC> SResiduals 'SRES4'; SUBC> TResiduals 'TRES4'. General Linear Model: acuity-1 versus eye, power, person Factor Type Levels Values eye fixed 2 left, right power fixed 4 6|6, 6|18, 6|36, 6|60 person random 7 1, 2, 3, 4, 5, 6, 7 Analysis of Variance for acuity-1, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P eye 1 91.075 77.333 77.333 1.05 0.344 x power 3 90.496 94.762 31.587 3.40 0.039 x eye*power 3 5.499 7.816 2.605 0.31 0.817 person 6 1121.524 977.537 162.923 2.17 0.183 x eye*person 6 569.636 445.537 74.256 8.87 0.000 power*person 18 167.388 167.388 9.299 1.11 0.416 Error 17 142.309 142.309 8.371 Total 54 2187.927 x Not an exact F-test. S = 2.89328 R-Sq = 93.50% R-Sq(adj) = 79.34% Unusual Observations for acuity-1 Obs acuity-1 Fit SE Fit Residual St Resid 47 94.000 94.000 2.893 0.000 * X 51 105.000 109.854 2.399 -4.854 -3.00 R 55 115.000 110.146 2.399 4.854 3.00 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 eye (7) + 3.7895 (5) + Q[1, 3] 2 power (7) + 1.9048 (6) + Q[2, 3] 3 eye*power (7) + Q[3] 4 person (7) + 1.9167 (6) + 3.8333 (5) + 7.6667 (4) 5 eye*person (7) + 3.8333 (5) 6 power*person (7) + 1.9444 (6) 7 Error (7) ... Variance Components, using Adjusted SS Estimated Source Value person 11.4459 eye*person 17.1874 power*person 0.4774 Error 8.3711