Sample size calculation: comparison of two proportions
| Command: | Sample size |
Calculates the required sample size for the comparison of two proportions. The sample size takes into account the required significance level and power of the test (see Sample size calculation: Introduction).
Required input
- Type I error - alpha: the probability of making a Type I error (α-level, two-sided), i.e. the probability of rejecting the null hypothesis when in fact it is true.
- Type II error - beta: the probability of making a Type II error (β-level), i.e. the probability of accepting the null hypothesis when in fact it is false.
- Proportion in group 1 (%): hypothesized proportion in the first sample.
- Proportion in group 2 (%): hypothesized proportion in the second sample (the hypothesized difference with the first proportion is considered to be biologically significant).
- Ratio of sample sizes in Group 1 / Group 2: the ratio of the sample sizes in group 1 and 2. Enter 1 for equal sample sizes in both groups. Enter 2 if the number of cases in group 1 must be double of the number of cases in group 2.
- Statistical analysis: select the statistical test that will be used to analyze the study data: Chi-squared test or Fisher's exact test.
Example
In the example you are interested in detecting a difference between two proportions of a least 15. You expect the two proportions to be equal to 75 and 60 in group 1 and 2 respectively. You will include twice as many cases in group 1 as in group 2. You plan to analyse the results of your study using a Chi-squared test.
For α-level you select 0.05 and for β-level you select 0.20 (power is 80%).
After you click Calculate the program displays the required sample size, which is 224 in the first group and 112 in the second group, i.e. 336 cases in total.
A table shows the required sample size for different Type I and Type II Error levels.
Literature
- Machin D, Campbell MJ, Tan SB, Tan SH (2009) Sample size tables for clinical studies. 3rd ed. Chichester: Wiley-Blackwell.