Compare the mean of a continuous measurement in two samples. This calculator determines sample size given clinically significant effect size and allows for clustered sampling. Although the t-test will be used to compare the means, this calculator approximates the t-statistic with the z-statistic.

Instructions: Enter parameters in the red cells. Answers will appear in blue below.

Step 1: Calculate sample sizes without adjustment for clustering

α (two-tailed) = Threshold probability for rejecting the null hypothesis. Type I error rate.
β = Probability of failing to reject the null hypothesis under the alternative hypothesis. Type II error rate.
q1 = Proportion of subjects that are in Group 1 (exposed)
q0 = 0.600 Proportion of subjects that are in Group 0 (unexposed); 1-q1
E = Effect size
S = Standard deviation of the outcome in the population

The standard normal deviate for α = Zα =

The standard normal deviate for β = Zβ =

A = (1/q1 + 1/q0) =

B = (Zα+Zβ)2 =

Standardized Effect Size = (E/S) =

Without correction for clustering:

Total group size = Ntotal = AB/(E/S)2 =

N1:

N0:

Ntotal:




Step 2: Calculate sample sizes with adjustment for clustering

Your study has either:
a. a fixed number of clusters per group (C1 and C0) or
b. a fixed cluster size m.

a. Fixed number of clusters per group

By fixing the number of clusters (C1), you limit the value of ρ. The larger C1, the larger ρ can be.

q1 = 0.500 Proportion of subjects that are in Group 1 (exposed)
N1 = 0.00 Size of group 1 (without adjustment)
C1 = Number of clusters in Group 1 (must be at least 1 and less than N1)
ρ = Within-cluster correlation coefficient (must be greater than 0 and less than C1/N1 = 0.000)

Cluster size = m = (1-ρ)/((C1/N1)-ρ) =

Design Effect = 1+(ρ(m-1)) =

m (rounded):

N'1:

N'0:

N'total:




b. Fixed cluster size

With a fixed cluster size, ρ can take any value between 0 and 1.

Ntotal = Total group size (without adjustment)
q1 = 0.500 Proportion of subjects that are in Group 1 (exposed)
m = Cluster size
ρ = Within-cluster correlation coefficient (must be greater than 0 and no greater than 1)

Design Effect = 1+(ρ(m-1)) =

Clusters in Group 1 = C1 = Ntotal * Design Effect * q1 / m =

Clusters in Group 0 = C0 = Ntotal * Design Effect * q0 / m =

N'1:

N'0:

N'total:

Because the formula used here is based on approximating the t statistic with a z statistic, it will slightly underestimate the sample size when N is less than about 30.