Method document
Sample size for a sign test
How many participants, or pairs, are needed to show that changes are more often positive than negative, using the exact sign test. Covers one- or two-sided tests and dropout.
https://statwisely.com/methods/nonparametric-sign/
When to use it
- Paired outcomes recorded only as better or worse, or changes too irregular for any other test.
Not for
- Changes measured on a scale: the signed-rank test uses their sizes and needs fewer pairs.
Notation
- Number of pairs with a non-zero change
- P(D > 0): chance a change is positive
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Number of tails: 2 for a two-sided test, 1 for one-sided
- Expected dropout
Formulas
Exact binomial power
The number of positive changes is binomial; under no effect p = ½. Because counts are whole numbers, power rises and falls with n, and the size reported is the one from which it stays above the target [1].
Dropout
Applied last, to the participants actually recruited.
Parameters
P(D > 0)
Values: Between 0 and 1, not 0.5
The share of pairs expected to improve, among those that change.
Difference, instead of pOptional
Values: Not zero
With the SD, p is derived assuming normal data, so the parametric test’s cost can be shown alongside.
Standard deviationOptional
Values: Above 0
Given with the difference.
Significance level
Values: Between 0 and 1; usually 0.05
The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.
Power
Values: Between 0 and 1; usually 0.80 or 0.90
The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.
One- or two-sided
Values: 2 (two-sided) or 1 (one-sided)
Two-sided is the default. A one-sided test is justified only when an effect in the other direction would be treated exactly as no effect, and should be stated in advance.
Expected dropoutOptional
Values: 0% up to, but not including, 100%
The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.
Assumptions
- Pairs are independent; pairs with no change are excluded, so allow for them in recruitment.
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
Worked examples
Sixty-five per cent improve
p = 0.65, α = 0.05 two-sided, 80% power: power first reaches 80% at 90 pairs, and stays above it from 97.
Sample size: 97
Open this example in the calculatorProtocol statement
To detect a probability of 0.65 that a change is positive with 80% power at a two-sided significance level of 0.05, using an exact sign test, the required sample size is 97 pairs. Calculated with StatWisely (statwisely.com) using: n: exact binomial power of a sign test at p=P(D>0). These are planning estimates; confirm the final design with a qualified statistician.
Allowing for dropout
Expecting 10% to have no usable pair: 108 are enrolled.
Needed for analysis: 97 · To recruit: 108
Open this example in the calculatorProtocol statement
To detect a probability of 0.65 that a change is positive with 80% power at a two-sided significance level of 0.05, using an exact sign test, the required sample size is 97 pairs. Allowing for 10% dropout, 108 pairs should be recruited. Calculated with StatWisely (statwisely.com) using: n: exact binomial power of a sign test at p=P(D>0). These are planning estimates; confirm the final design with a qualified statistician.
Validation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
How to cite
StatWisely. Sample size for a sign test. Method document, engine version 1.0.0, reviewed 2026-10-02. https://statwisely.com/methods/nonparametric-sign/
Cite the original references for the formulas your design uses as well.
References
- 1.Chernick MR, Liu CY. The saw-toothed behavior of power versus sample size and software solutions: single binomial proportion using exact methods. The American Statistician. 2002;56(2):149–155.