# 10.7 - Compare Two Means

## Example Section

Suppose investigators plan an intervention study to help individuals lower their cholesterol, and randomize patients to participate in their new intervention or a control group. They hypothesize at the end of their 6-month intervention the intervention group will have cholesterol levels down to about 5.3, while the control group's cholesterol levels will still be about 6. They assume the standard deviation will still be about 1.4. What sample size is needed to detect this difference with a one-sided alpha of 0.05 and a power of 90%?

## Formula Section

We are interested in testing the following hypothesis:

$$\begin{array}{l} \mathrm{H}_{0}\colon \mu_{1}=\mu_{2} \\ \mathrm{H}_{1}\colon \mu_{1}-\mu_{2}=\delta, \end{array}$$

The formula needed to calculate the sample size is:

$$\displaystyle{n=\frac{(r+1)^{2}\left(z_{\alpha}+z_{\beta}\right)^{2} \sigma^{2}}{\delta^{2} r}}$$

Where...

• $$\mu_{1}$$= hypothesized mean in group 1
• $$\mu_{2}$$= hypothesized mean in group 2
• $$\delta$$= difference in means (null hypothesis $$\delta = 0$$, alternative hypothesis $$\delta \ne 0$$)
• $$\sigma$$ = standard deviation
• $$r = \dfrac{n_1}{n_2}$$

From the formula, we can calculate that n=137, but after rounding to the next highest even number, n=138, with 69 per group.

To use the table below, we can calculate S= (6.0-5.3)/1.4 = 0.5.  For a one-sided alpha of 0.05, we need to use the column for alpha =5%, and 90% power. Reading down to S=0.5, we see n=35. Back to the table header directions, we see that for a test of the difference between two means, we need to multiply the value by 4. Thus, 35*4 = 140 is the total sample size needed.

Sample Size Statement:  A total sample size of n=138 (69 per group) is needed to detect a 0.7 mmol/l difference in mean cholesterol using a two-group t- test with one-sided alpha of 0.05 and 90% power, and assuming a common standard deviation of 1.4.

Table B.7. Sample size requirements for testing the value of a single mean or the difference between two means.

The table gives requirements for testing a single mean with a one-sided test directly. For two-sided tests, use the column corresponding to half the required significance level. For tests of the difference between two means, the total sample size (for the two groups combined) is obtained by multiplying the requirement given below by 4 if the two samples sizes are equal or by $$(r+1)^{2} / r$$ if the ratio of the first to the second is $$r : 1$$ (assuming equal variances).
Note that $$S$$ = difference/standard deviation.
5%
Significance
2.5%
Significance
1%
Significance
0.5%
Significance
0.1%
Significance
0.05%
Significance
$$S$$ 90%
Power
95%
Power
90%
Power
95%
Power
90%
Power
95%
Power
90%
Power
95%
Power
90%
Power
95%
Power
90%
Power
95%
Power
0.01 85 639 108 222 105 075 129 948 130 170 157 705 148 794 178 142 191 125 224 211 209 040 243 580
0.02 21 410 27 056 26 269 32 487 32 543 39 427 37 199 44 536 47 782 56 053 52 260 60 895
0.03 9 516 12 025 11 675 14 439 14 464 17 523 16 533 19 794 21 237 24 913 23 227 27 065
0.04 5 353 6 764 6 568 8 122 8 136 9 587 9 300 11 134 11 946 14 014 13 065 15 224
0.05 3 426 4 329 4 203 5 198 5 207 6 309 5 952 7 126 7 645 8 969 8 362 9 744
0.06 2 379 3 007 2 919 3 610 3 616 4 381 4 134 4 949 5 310 6 229 5 807 6 767
0.07 1 748 2 209 2 145 2 652 2 657 3 219 3 037 3 636 3 901 4 576 4 267 4 972
0.08 1 339 1 691 1 642 2 031 2 034 2 465 2 325 2 784 2 987 3 504 3 267 3 806
0.09 1 058 1 334 1 298 1 605 1 608 1 947 1 837 2 200 2 360 2 769 2 581 3 008
0.10 857 1 083 1 051 1 300 1 302 1 578 1 488 1 782 1 912 2 243 2 091 2 436
0.15 381 481 467 578 579 701 662 792 850 997 930 1 083
0.20 215 271 263 325 326 395 372 446 478 561 523 609
0.25 138 174 169 208 209 253 239 286 306 359 335 390
0.30 96 121 117 145 145 176 166 198 213 250 233 271
0.35 70 89 86 107 107 129 122 146 157 184 171 199
0.40 54 68 66 82 82 99 93 112 120 141 131 153
0.45 43 54 52 65 65 78 74 88 95 111 104 121
0.50 35 44 43 52 53 64 60 72 77 90 84 98
0.55 29 36 35 43 44 53 50 59 64 75 70 81

(from Woodward, M. Epidemiology Study Design and Analysis. Boca Raton: Chapman and Hall, 2013, p.770)