Sign Test
Simple nonparametric test for paired data; tests if median difference is zero by counting positive vs. negative differences.
What is it?
Sign Test evaluates the directional differences between paired scores based purely on their positive (+) or negative (-) signs, ignoring magnitude.
When to use it
- Highly Skewed Metrics: Outliers render differences uninterpretable.
- Pure Direction: Only the direction of change (growth vs decline) is verified.
Core Idea
Under the null hypothesis, positive and negative signs should occur with equal probability (p = 0.50). An excess of either sign rejects H0:
Hypotheses
How it works
- Calculate differences between paired measurements.
- Assign positive (+) or negative (-) signs, discarding ties.
- Count occurrences of the less frequent sign (k).
- Evaluate cumulative binomial probability with p = 0.5.
Assumptions
Effect Size
Represented using **Cohen's g**: g = (positives / total) - 0.5. Ranges from -0.5 to +0.5, where 0 represents the null profile.
Quick Example
| Positive (+) | Negative (-) | Binomial p |
|---|---|---|
| 15 | 5 | 0.041 (Significant) |
Binomial Sign Live Laboratory
Adjust the positive success probability rate to see binomial separation.
| Metric | Value |
|---|---|
| Positive Signs (+) | 8 |
| Negative Signs (-) | 12 |
| Cumulative Binomial p | 0.5034 |
Hypotheses
Pragmatic null and alternative hypotheses defined in mathematical notation.
H₀: P(X > Y) = 0.5 (probability of positive difference equals probability of negative difference)
Hₐ: P(X > Y) ≠ 0.5 (more positive than negative differences, or vice versa)
Tests whether positive and negative differences are equally likely. Unlike Wilcoxon, uses only direction (+/-) not magnitude. Based on binomial distribution under H₀: p = 0.5.
Assumptions
The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.
Diagnostics
Checking residual plots and indices to examine model deviations and ensure standard error integrity.
- Count of positive differences (n+)
- Count of negative differences (n-)
- Count of zero differences (excluded)
- Effective sample size (n = n+ + n-)
- Histogram of differences (to show why Sign test chosen over Wilcoxon)
- Proportion of positive differences
- Binomial probability under H₀ (p = 0.5)
- 95% CI for proportion of positive differences
Applied Minds
Review concrete study examples, data layout guidelines, and copy executable syntax scripts.
Preference for Meditation vs. Exercise (Severely Skewed Differences)
Research question: Do participants rate meditation higher than exercise for stress reduction? Design: Within-subjects (n=50), each rates both on 0-100 scale. Outcome: Difference scores (Meditation - Exercise) severely right-skewed with outliers. Sign test chosen because Wilcoxon symmetry assumption violated.
# Sign Test: Meditation vs. Exercise preference (skewed data)
library(DescTools)
library(tidyverse)
set.seed(2025)
n <- 50
data <- data.frame(
id = 1:n,
meditation = round(rnorm(n, 65, 18)),
exercise = round(rnorm(n, 58, 15))
)
data$difference <- data$meditation - data$exercise
# Check skewness (justifies Sign test over Wilcoxon)
skew <- moments::skewness(data$difference)
cat("Skewness =", round(skew, 2), "\n")
cat("Severely skewed → Sign test appropriate\n\n")
# Count signs
n_pos <- sum(data$difference > 0) # Meditation > Exercise
n_neg <- sum(data$difference < 0) # Exercise > Meditation
n_zero <- sum(data$difference == 0) # Ties (excluded)
n_effective <- n_pos + n_neg
cat("Positive differences(Meditation > Exercise):", n_pos, "\n")
cat("Negative differences(Exercise > Meditation):", n_neg, "\n")
cat("Zero differences(ties, excluded):", n_zero, "\n")
cat("Effective n =", n_effective, "\n\n")
# Sign Test
sign_result <- SignTest(data$meditation, data$exercise, alternative="two.sided")
print(sign_result)
# Manual calculation: binomial test
binom_result <- binom.test(n_pos, n=n_effective, p=0.5, alternative="two.sided")
print(binom_result)
# Effect size: proportion of positive differences
prop_pos <- n_pos / n_effective
cat("\nProportion favoring meditation:", round(prop_pos, 2), "\n")
cat("95% CI:", round(binom_result$conf.int, 2), "\n")
# Visualize
ggplot(data, aes(x=difference)) +
geom_histogram(bins=20, fill="steelblue", alpha=0.7) +
geom_vline(xintercept=0, color="red", linetype="dashed", size=1) +
labs(title="Severely Skewed Differences → Sign Test",
subtitle=paste("Skewness =", round(skew, 2)),
x="Difference(Meditation - Exercise)") +
theme_minimal()
# APA Report
cat("\n=== APA Report ===\n")
cat(paste0(
"A Sign test was conducted to compare preference ratings for meditation vs. exercise. ",
"The test was chosen because difference scores were severely skewed(skew = ", round(skew, 2), "), ",
"violating Wilcoxon's symmetry assumption. Of ", n_effective, " participants with non-zero differences, ",
n_pos, " rated meditation higher and ", n_neg, " rated exercise higher(Sign test p ",
ifelse(binom_result$p.value < 0.001, "< .001", paste("=", round(binom_result$p.value, 3))), "). ",
"Proportion favoring meditation: ", round(prop_pos, 2), ", 95% CI [",
round(binom_result$conf.int[1], 2), ", ", round(binom_result$conf.int[2], 2), "]."
))Sign test p = .012. Of 48 participants with non-zero differences, 32 (67%) preferred meditation over exercise, 95% CI [52%, 79%]. Severely skewed differences (skew = 1.85) made Wilcoxon inappropriate; Sign test valid regardless of shape.
Alternatives
Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.
- Wilcoxon Signed-Rank — Return to the rank-weighted strike to increase power by 30%.
- Zero-Augmented Sign Test — Account for the clinical meaning of 'No Change' participants.
- McNemar Strike — Treat 'Zero' as a stable state in a 2x2 grid.
Post-hoc
Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.
Post-hoc pairwise tests defined for this model.
The Sign Test is the most robust audit of 'Momentum'. If your participants don't even agree on the *direction* of change, your intervention lacks a unified clinical story.
Effect Size
Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.
Range: 0 to 1. Under H₀: p = 0.5. Report with 95% CI. Example: 'Proportion improved: 0.72, 95% CI [0.58, 0.83]'
p_positive - p_negative. Range: -1 to +1. Example: 0.72 - 0.28 = 0.44 (44% more positive than negative)
0.2
0.5
0.8
Sample Size
Guidelines for minimum sample requirements and power analysis parameters.
At least 10 pairs for reasonable power. For n < 25, use exact binomial test (not normal approximation)
| Effect Size | Parameters | Required n |
|---|---|---|
| Small Effect | p = 0.60 (60% positive) | n ≈ 130 pairs |
| Medium Effect | p = 0.70 (70% positive) | n ≈ 23 pairs |
| Large Effect | p = 0.80 (80% positive) | n ≈ 9 pairs |
Reporting
How to compile statistical results into publication prose matching APA and journal style guides.
A Sign test was conducted to compare condition 1 and condition 2. State why Sign test chosen: 'The Sign test was used due to severely skewed differences (skewness = X.XX) violating Wilcoxon's symmetry assumption' OR 'to ensure robustness to extreme outliers'. Of n_effective participants with non-zero differences, n_positive showed improvement and n_negative showed worsening (Sign test p = .XXX). The proportion showing improvement was proportion, 95% CI XX%, XX%. Interpret in context.
- Number of positive differences
- Number of negative differences
- Number of zeros (excluded)
- Effective sample size
- p-value (from binomial test)
- Proportion of positive differences with 95% CI
- Justification for using Sign test over Wilcoxon
Manuscript Lab
Copy standard summary tables and forensic reporting grids to outline analysis details.
| Comparison | Positive (+) Shifts | Negative (-) Shifts | Ties | p-value |
|---|---|---|---|---|
| Post - Pre | 38 | 8 | 4 | < .001 |
The 'Directional Winners'. The number of subjects who improved, regardless of by how much.
Binomial Probability. The chance of getting 38/50 'heads' if the intervention was a random coin flip.
Command Center
Syntax libraries and function parameters for executing calculations in stats packages.
# 1. Execute Sign Test
DescTools::SignTest(x, y)The Sign test only considers the direction of change, completely ignoring magnitude. If differences are symmetric, the Wilcoxon signed-rank test is much more powerful.
# Compare directly to Wilcoxon Signed-Rank Test
wilcox.test(x, y, paired = TRUE)Common Mistakes
Analytical caveats and corrections to maintain modeling integrity.
References
Scholarly lineage and citation keys grounding the statistical framework.