Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu Show menu

Sample size calculation: Comparison of two means

Description

Calculates the required sample size for the comparison of two independent means. 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.
  • Difference of means: the hypothesized difference (considered to be biologically significant).
  • Standard deviation in group 1 : hypothesized standard deviation in the first sample.
  • Standard deviation in group 2 : hypothesized standard deviation in the second sample.
  • 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.

Correction for unequal variances

When you enter the same standard deviation for both samples, it is assumed that the data will be analyzed using the Independent samples t-test with the option "Assume equal variances". When you enter two different standard deviations, it is assumed that the data will be analyzed using the Independent samples t-test with the option "Assume unequal variances". See Independent samples t-test.

Example

In the example you are interested in detecting a difference between the sample means of a least 10. You expect the standard deviations in the two studies to be equal to 16. You expect to include twice as many cases in group 1 as in group 2.

For α-level you select 0.05 and for β-level you select 0.20 (power is 80%).

Sample size calculation for comparison of two means.

After you click Calculate the program displays the required sample size, which is 61 for group 1 and 31 in group 2, or a total of 92 cases.

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.

See also