CalcWorldHub
Free online calculator · no signup

Sample size for difference in proportions calculator

Estimate equal group sizes for a two-sided comparison of two planned independent proportions using a normal approximation.

Sample size for difference in proportions calculator — Expected group 1 proportion (%), Expected group 2 proportion (%), Significance level (%) and calculation method
Sample size for difference in proportions calculator: inputs and calculation method.

How to use this calculator

Estimate equal group sizes for a two-sided comparison of two planned independent proportions using a normal approximation.

  1. Enter Expected group 1 proportion (%), Expected group 2 proportion (%), Significance level (%), Target power (%). Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

How Sample size for difference in proportions calculator works

Estimate equal group sizes for a two-sided comparison of two planned independent proportions using a normal approximation.

Inputs and units

  • Expected group 1 proportion (%): Expected group 1 proportion is entered as a percent between 0% and 100%, exclusive.
  • Expected group 2 proportion (%): Expected group 2 proportion uses the same definition and must differ from group 1.
  • Significance level (%): Significance level α is a percent strictly between 0% and 100%.
  • Target power (%): Target power is entered as a percent strictly between 0% and 100%.

Formula and method

n per group = ceil(2 p̄(1−p̄)(z₁₋α/₂+z_power)²/(p₁−p₂)²), where p̄=(p₁+p₂)/2.

Worked example

For p₁=30%, p₂=40%, α=5%, and power=80%, z₁₋α/₂≈1.96 and z_power≈0.842; the formula gives about 357.2, so use 358 per group.

Interpreting the result

The displayed count is for each group; total planned observations are twice that number. It is a planning approximation for a specified difference, not an analysis of observed study data.

Assumptions and limits

Assumes equal-sized independent groups and a two-sided normal approximation. It excludes attrition, clustering, continuity correction, multiplicity, and alternative allocation ratios.

Sources and method

Frequently asked questions

Why must the expected proportions differ?

If p₁=p₂, the planned difference is zero and the required sample size for detecting that difference is unbounded.

Why are two group counts needed?

The formula returns n for each equally sized group; the total is 2n.

How do I use the Sample size for difference in proportions calculator?

Enter Expected group 1 proportion (%), Expected group 2 proportion (%), Significance level (%), Target power (%). Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Sample size for difference in proportions?

For p₁=30%, p₂=40%, α=5%, and power=80%, z₁₋α/₂≈1.96 and z_power≈0.842; the formula gives about 357.2, so use 358 per group.

What does the Sample size for difference in proportions calculator calculate?

Estimate equal group sizes for a two-sided comparison of two planned independent proportions using a normal approximation.

Related calculators