Solution file for GO Exercise 7.5 --------------------------------- Planning of a study on comparing the quality of video tapes of 6 different brands. The outcome is a distortion measure, with an estimated variance of 0.25, i.e. sigma=0.5. a) We need to think a bit about how the question is to be interpreted. First, what test is referred to? The possible interpretations are the overall F-test for equality between brands and a test targeted at comparing high and low cost brands (from a suitably designed contrast). For this solution, I have chosen the first interpretation. Second, what information exactly is provided about the alternative hypothesis we will work under? For this solution, I have chosen the simple interpretation that true difference between high and low cost tapes equals 1 unit, and that no substantial differences between tape brands exist. With 4 tapes of each brand, a true difference of 1 unit between the tapes of best and poorest quality, and a significance level of 0.01, we compute the power using Minitab as follows: MTB > Power; SUBC> OneWay 6; SUBC> Sample 4; SUBC> MaxDifference 1; SUBC> Sigma .5; SUBC> Alpha 0.01. Power and Sample Size One-way ANOVA a = 0.01 Assumed standard deviation = 0.5 Factors: 1 Number of levels: 6 Maximum Sample Difference Size Power 1 4 0.186276 The sample size is for each level. Comments: --------- This calculation is available in Stata only through the add-on command fpower, as follows: fpower , a(6) alpha(.01) delta(2) (here, the value for delta is computed as: effect/sd = 1/0.5 = 2). If one wanted to use the Stata menu or the R function power.anova.test, one would need to know (hypothesize) the means of all groups, not only the two most extreme ones. Powers will be different depending on how the other group means are set, but we can make the following assessments: highest power: three means at 0, three means at 1 lowest power: one mean at 0, 4 means at 0.5, one mean at 1 This is because these two settings are the easiest and most difficult ones, respectively, for the one-way ANOVA. The Stata listings below show that the first of these has much higher power, and the second has the same power as above. . power oneway 0 0 0 1 1 1, varerror(.25) alpha(0.01) npergroup(4) Estimated power for one-way ANOVA F test for group effect ... Estimated power: power = 0.7313 . power oneway 0 0.5 0.5 0.5 0.5 1, varerror(.25) alpha(0.01) npergroup(4) Estimated power for one-way ANOVA F test for group effect ... Estimated power: power = 0.1863 Because the study involves four high cost tapes and two lost cost tapes, it would perhaps make most sense to consider the following group means: . power oneway 0 0 1 1 1 1, varerror(.25) alpha(0.01) npergroup(4) Estimated power for one-way ANOVA F test for group effect ... Estimated power: power = 0.6587 See appendix for the same calculations using R. b) 95% CI for mean group differences should have a length of at most 2. We give two solutions, for different interpretations of the question. The simplest interpretation (i) is that the CI is based on a difference between two of the 6 groups. Only slightly more complex is the situation (ii) where the CI is obtained from a contrast based on the first 4 groups. (i) For (i), the constant A(n) equals sqrt(2/n), where n is the sample size in each of the groups. This is because the standard error of the mean difference of two groups is sigma*sqrt(2/n). Therefore, we must solve the equation (for the margin of error) 1 >= 2*sigma*sqrt(2/n) => n >= (2*sigma*sqrt(2)/1)^2 = 2 The degrees of freedom for error with 6 groups of 2 will be 6, so we rerun the calculation with 2 replaced by t(6,0.975)=2.447. 1 >= 2.447*sigma*sqrt(2/n) => n >= (2.447*sigma*sqrt(2)/1)^2 = 3 A sample size of 3 in each group should be sufficient to get 95% confidence intervals for pairwise comparisons of length 2. Note that with a residual standard deviation of 0.5, this is a fairly modest requirement. (ii) For (ii), the relevant contrast for A-B is theta = 0.5*mu1 + 0.5*mu2 - 0.5*mu3 - 0.5*mu4. Because each of the group means will have variance sigma^2/n, the contrast estimate will have variance 0.5^2 * sigma^2/n + ... + 0.5^2 * sigma^2/n (4 terms) = sigma^2/n, and A(n)=sqrt(1/n). We can now use the same approach as above, and the first calculation will give us: n >= (2*sigma)^2 = 1. The minimal group size is 2, so we redo the calculation (as above) with 2.447: n >= (2.447*sigma)^2 = 1.5. Therefore, the minimal group size of 2 will give a CI for the contrast for A-B with a length less than 2. --- Appendix: output for a) from power calculation using R function: > power.anova.test(groups=6, n=4, between.var=var(c(0,0,0,1,1,1)), within.var=0.25, sig.level=0.01) Balanced one-way analysis of variance power calculation groups = 6 n = 4 between.var = 0.3 within.var = 0.25 sig.level = 0.01 power = 0.7312544 NOTE: n is number in each group > power.anova.test(groups=6, n=4, between.var=var(c(0,.5,.5,.5,.5,1)), within.var=0.25, sig.level=0.01) Balanced one-way analysis of variance power calculation groups = 6 n = 4 between.var = 0.1 within.var = 0.25 sig.level = 0.01 power = 0.1862755 NOTE: n is number in each group > power.anova.test(groups=6, n=4, between.var=var(c(0,0,1,1,1,1)), within.var=0.25, sig.level=0.01) Balanced one-way analysis of variance power calculation groups = 6 n = 4 between.var = 0.2666667 within.var = 0.25 sig.level = 0.01 power = 0.6587254 NOTE: n is number in each group