Statistical Calculators › Proportions: One and Two Groups › Risk Difference Test Sample Size
← All Calculators

Proportions: One and Two Groups

Risk Difference Test Sample Size

Calculate the sample size required to test a specified difference between two independent proportions using the Farrington & Manning likelihood score method. Enter the null risk difference, expected alternative risk difference, reference-group event rate, significance level, desired power, and allocation ratio. Runs entirely in your browser.

Study Design

Farrington & Manning likelihood score test for two independent proportions.

Sample Size Results

The calculation uses the normal-approximation power method for the Farrington & Manning likelihood score statistic.
Enter the study assumptions and click Calculate Sample Size.

Methodology

The risk difference is defined as δ = p1 − p2, where p1 is the event probability in Group 1 and p2 is the event probability in Group 2. The calculator tests a specified null value δ0 rather than assuming that the null difference must be zero.

The implemented test is the Farrington & Manning likelihood score test. Under the null hypothesis, the score statistic uses maximum-likelihood estimates constrained to satisfy p1 − p2 = δ0. Under the alternative, the expected proportions are p1 = p2 + δ1 and p2. The required sample size is found by searching for the smallest integer group size that reaches the requested normal-approximation power.

Hypotheses

Upper-tailed: H0: p1 − p2 ≤ δ0   vs.   H1: p1 − p2 > δ0
Lower-tailed: H0: p1 − p2 ≥ δ0   vs.   H1: p1 − p2 < δ0
Two-sided: H0: p1 − p2 = δ0   vs.   H1: p1 − p2 ≠ δ0

Farrington & Manning Score Statistic

Let p̃1 and p̃2 denote the constrained maximum-likelihood estimates satisfying p̃1 − p̃2 = δ0. The Farrington & Manning statistic is

zF = (p̂1 − p̂2 − δ0) / √[ p̃1(1−p̃1)/n1 + p̃2(1−p̃2)/n2 ]

The constrained estimates are obtained by solving the likelihood score equation subject to the null restriction. For sample-size planning, the observed proportions are replaced by their anticipated alternative values. The normal approximation is then used to determine the sample size producing the requested power.

Sample Size Search

For a specified allocation ratio k = n2/n1, the calculator searches over integer values of n1, sets n2 = round(k n1), and evaluates the resulting normal-approximation power. The reported design is the first integer allocation reaching the requested target power.

Validation example: the published Example 2 specifies an upper-tailed Farrington & Manning test with α = 0.05, 80% power, equal allocation, δ0 = −0.05, δ1 = 0.05, and p2 = 0.60. The published result is n1 = 290 and n2 = 290, for a total sample size of 580. This implementation reproduces that result; at 290 per group its calculated normal-approximation power is approximately 0.80067.

Interpretation

The risk difference is an absolute effect measure. For example, a risk difference of 0.10 means that the event probability in Group 1 is 10 percentage points higher than that in Group 2. The null difference δ0 allows the same framework to represent superiority, non-inferiority, or other tests in which the null hypothesis specifies a non-zero difference.

References

Farrington, C. P., & Manning, G. (1990). Test statistics and sample size formulae for comparative binomial trials with null hypothesis of non-zero risk difference or non-unity relative risk. Statistics in Medicine, 9(12), 1447–1454. doi:10.1002/sim.4780091208.

the software. this method Sample Size Software: Non-Zero Null Tests for the Difference Between Two Proportions, Chapter 205. the relevant methodological literature describes the Farrington & Manning likelihood score test, its constrained estimates, normal-approximation calculations, and worked sample-size examples.