Exact sign test
Hypothesis tests · Method and input reference
Exact two-sided binomial test of signs relative to a reference. Enter one-sample values, or precomputed within-pair differences with reference 0. Zeros are counted and omitted. Independent observations/pairs required; a continuous median interpretation needs no point mass at the reference. Synthetic example: 40 independent simulated changes in outcome units; no patient records.
Open calculator · Compare methods in the decision matrix
When to consider it
- Test whether positive and negative differences are equally likely, using the exact sign test.
Assumptions and scope
- For paired data, calculate x minus y for each pair and enter those differences with reference 0.
- Independent observations/pairs; zeros are counted and omitted. A continuous median interpretation needs no point mass at the reference.
Direction only; discards difference magnitudes.
Required inputs
- Observations or differences — Numeric observations; preserve the row and column structure described above.
- Reference location — Enter the method parameter described above.
Review missing values and data coding before running. Sample inputs are synthetic teaching examples.
Implementation
Exact two-sided binomial test of signs relative to a reference. Enter one-sample values, or precomputed within-pair differences with reference 0. Zeros are counted and omitted. Independent observations/pairs required; a continuous median interpretation needs no point mass at the reference. Synthetic example: 40 independent simulated changes in outcome units; no patient records.
- scipy 1.15.3: scipy.stats.binomtest
These are pinned library versions; saved results record the versions actually used at runtime.