Solution file for Additional exercise 12.1 ------------------------------------------ Planning of a study on turtle shell lengths. Standard deviation sigma=2.1 cm. Question a): ------------ For a 95% CI with a length of 2 cm (and a margin of error of 1cm), we must solve: 1 >= 2*sigma/sqrt(n) => n >= (2*sigma/1)^2 = (2*2.1)^2 = 17.64; take n=18. Because the resulting n is fairly small, we redo the calculation while replacing 2 by t(17,0.975)=2.11: 1 >= 2.11*sigma/sqrt(n) => n >= (2.11*sigma/1)^2 = (2.11*2.1)^2 = 19.63; take n=20. Minitab command and output: MTB > SSCI; SUBC> NMean; SUBC> Sigma 2.1; SUBC> Confidence 95.0; SUBC> IType 0; SUBC> MError 1. Sample Size for Estimation Method Parameter Mean Distribution Normal Standard deviation 2.1 (estimate) Confidence level 95% Confidence interval Two-sided Results Margin Sample of Error Size 1 20 Question b): ------------ Interest is in an effect size of 1cm, so according to Cox's rule, we take 1 = 3*sigma/sqrt(n) => n = (3*sigma/1)^2 = 39.69; take n=40. Question c): ------------ We use Minitab's power menu (see appendices for Stata and R listings) to compute necessary sample sizes to obtain powers 0.7, 0.8 or 0.9 with a significance level of 0.05: MTB > Power; SUBC> TOne; SUBC> Difference 1; SUBC> Power 0.7 0.8 0.9; SUBC> Sigma 2.1. Power and Sample Size 1-Sample t Test Testing mean = null (versus not = null) Calculating power for mean = null + difference Alpha = 0.05 Assumed standard deviation = 2.1 Sample Target Difference Size Power Actual Power 1 30 0.7 0.712635 1 37 0.8 0.804705 1 49 0.9 0.904219 Comments: --------- It is seen that Cox's rule in this case leads to a power somewhat above 0.8. This could however easily change if we modified some of the settings for the test (i.e., the significance level and the two-sided alternative). The sample size in a) is based on a confidence interval with a margin of error of 1cm. This means that if the observed mean differs from the species average by 1cm, then one limit of the confidence interval will equal the species average. We can test the null hypothesis against a two-sided alternative at a significance level of 0.05 by checking whether the hypothesized value is inside the confidence interval. As in this case it is on its boundary, P=0.05. The assumption for this is that a two-sided alternative hypothesis is used. The confidence interval gives a statement about an observed mean, but power calculations give statements about the datasets that might result under the alternative hypothesis. Even if the true difference was 1cm, the observed difference would not (most unlikely) be equal to 1cm. As the observed difference can be both less and more extreme, and we need a probability (power) of getting significance across all scenarios, it requires a larger sample size to ensure that the means we could get in the study are extreme enough. --- Appendix: output from power calculation using the Stata menu: . power onemean 0 1, power(0.7 0.8 0.9) sd(2.1) Performing iteration ... Estimated sample size for a one-sample mean test t test Ho: m = m0 versus Ha: m != m0 +---------------------------------------------------------+ | alpha power N delta m0 ma sd | |---------------------------------------------------------| | .05 .7 30 .4762 0 1 2.1 | | .05 .8 37 .4762 0 1 2.1 | | .05 .9 49 .4762 0 1 2.1 | +---------------------------------------------------------+ --- Appendix: output from power calculation using R function: > power.t.test(delta=1, sd=2.1, sig.level=0.05, power=0.7, type="one.sample", alternative="two.sided") One-sample t test power calculation n = 29.19071 delta = 1 sd = 2.1 sig.level = 0.05 power = 0.7 alternative = two.sided > power.t.test(delta=1, sd=2.1, power=0.8, type="one.sample") One-sample t test power calculation n = 36.58076 delta = 1 sd = 2.1 sig.level = 0.05 power = 0.8