UK-based online statistics and data analysis support for USA, UK, and international clients. No exams, no impersonation, no fabricated data.
Chi-Square and Categorical Data Tests

Sign Test: Formula, Example, Calculator, Interpretation, Python, R, SPSS and Excel Guide

Exact paired direction test with ties reported transparently Sign Test: Formula, Example, Calculator, Interpretation, Python, R, SPSS and Excel Guide The sign test is a distribution-free...

Statistics guide Ethical learning support SPSS/R/Python/Excel friendly
Sign Test: Formula, Example, Calculator, Interpretation, Python, R, SPSS and Excel Guide

Exact paired direction test with ties reported transparently

Sign Test: Formula, Example, Calculator, Interpretation, Python, R, SPSS and Excel Guide

The sign test is a distribution-free procedure for paired or one-sample median-direction questions. This worked analysis compares each student’s final grade (G3) with the same student’s second-period grade (G2) across 649 pairs, separates increases, decreases and ties, calculates the exact binomial probability, explains why the sample median difference can remain zero despite overwhelming directional evidence, and reproduces the result in Python, R, SPSS and Excel.

649 paired records290 increases72 decreases287 tiesExact p = 3.98 × 10−32

Sign Test Model Overview

The sign test asks whether positive and negative deviations are equally likely after observations equal to the null value are removed. For paired data, the deviation is the within-pair difference. In this analysis the difference is G3 − G2: a positive sign means the final grade increased, a negative sign means it decreased, and a zero difference is a tie.

The test deliberately ignores how large each change is. A rise of one grade point and a rise of six grade points each contribute one positive sign. This loss of magnitude information makes the sign test less powerful than methods that can safely use distances or ranks, but it also makes the method resistant to outliers, skewed difference distributions and extreme negative changes such as −9 or −8.

The Exact Research Question

Among students whose grade changed between G2 and G3, are increases and decreases equally likely? This conditional wording is essential because the 287 ties are documented but excluded from the exact binomial count.

H0: P(G3 − G2 > 0 | G3 ≠ G2) = 0.50
H1: P(G3 − G2 > 0 | G3 ≠ G2) ≠ 0.50
Worked-result preview: 290 of 362 non-tied pairs were positive, giving an observed positive-sign proportion of 0.801105. The exact two-sided sign test returned p = 3.9795987705 × 10−32, so equal positive and negative probabilities are decisively rejected.
Critical interpretation safeguard: the median of all 649 observed differences is 0 because 44.22% of pairs are ties. The valid conclusion is a strong positive directional imbalance among non-tied pairs—not the simplistic statement that “the observed median difference is significantly above zero.”
AdvertisementGoogle AdSense top placement reserved here

Quick Answer: Sign Test Result

The paired sign test classified each G3 − G2 difference by direction. There were 290 increases, 72 decreases and 287 ties. After ties were excluded, 80.11% of changed pairs were increases and 19.89% were decreases.

Positive changes290
Negative changes72
Non-tied n362
Exact two-sided p3.98 × 10−32

Statistical Decision

  • Procedure: exact paired sign test
  • Null probability: 0.50
  • Observed X: 290 positive signs
  • Decision at α = .05: reject H0
  • One-sided p: 1.9898 × 10−32

Data Meaning

  • 44.68% of all students increased.
  • 11.09% decreased.
  • 44.22% were tied.
  • Among changed pairs, increases outnumbered decreases by 4.03 to 1.
  • The net directional advantage was 60.22 percentage points.
Plain-language conclusion: among students whose grade changed, an increase from G2 to G3 was far more common than a decrease. The result is not driven by a normality assumption or by the size of a few extreme changes.

Table of Contents

  1. What the sign test means
  2. Research question and hypotheses
  3. When to use the sign test
  4. One-sample and paired variants
  5. Variables and data dictionary
  6. Formula and exact calculation
  7. Difference distribution and signs
  8. Complete statistical results
  9. Assumptions and diagnostics
  10. Comparison with related tests
  11. Sign test calculator workflow
  12. Python chart interpretations
  13. Paired R chart interpretations
  14. Python, R, SPSS and Excel workflows
  15. Expandable code
  16. APA reporting
  17. Common mistakes
  18. Practice questions
  19. Downloads
  20. Related guides
  21. Frequently asked questions
  22. Conclusion

What Is the Sign Test?

The sign test is a nonparametric test based only on whether each observation lies above or below a reference value. In a paired design, the reference value is zero for the within-pair difference. In a one-sample design, each observation is compared with a hypothesised population median.

Let di denote the difference for pair i. The sign test converts every nonzero di to “+” or “−”. Ties are removed from the exact binomial calculation. If the null hypothesis is true and the distribution is continuous around zero, positive and negative signs should each occur with probability 0.50.

What Information the Sign Test Uses

Pair identity

G2 and G3 must belong to the same student.

Direction

Only whether G3 is higher, lower or tied is required.

Non-tie count

The exact sample size is the number of positive plus negative signs.

Null sign probability

Usually 0.50 for no directional tendency.

What Information It Discards

The test does not use the size of each difference. The +6 change receives the same positive sign as each +1 change; similarly, a −9 change receives the same negative sign as a −1 change. Magnitudes remain valuable for descriptive interpretation, so this post reports them separately without allowing them to alter the exact sign-test statistic.

Distribution-free does not mean assumption-free: the sign test avoids normality and symmetry assumptions, but it still requires independent pairs, a meaningful within-pair comparison, correct tie handling and a sampling process that supports the intended population interpretation.

Research Question, Hypotheses and Paired Data Design

Earlier measureG2: second-period grade
Later measureG3: final grade
Paired differenced = G3 − G2

Research Question

Among students with a nonzero G3 − G2 difference, is the probability of an increase different from one half?

ComponentFormal statementApplied meaning
Null hypothesisH0: p+ = 0.50Increases and decreases are equally likely among changed pairs.
Two-sided alternativeH1: p+ ≠ 0.50The two directions are not equally likely.
Positive directional alternativeH1: p+ > 0.50Increases are more likely than decreases.
Negative directional alternativeH1: p+ < 0.50Decreases are more likely than increases.

Why Pairing Matters

The analysis is not a comparison of two independent grade samples. Each G2 value is matched to the same student’s G3 value. Ignoring this matching would mix between-student variation with within-student change. The sign test preserves the pairing by reducing each student’s two measurements to one direction.

Methods sentence: “A two-sided exact paired sign test evaluated whether positive and negative G3 − G2 changes were equally probable after zero differences were excluded.”

Good inference also depends on how the students entered the data. Review sampling methods and sampling bias before generalising beyond the observed sample.

When to Use the Sign Test

Use the Sign Test When

  • Measurements are paired or matched.
  • The scientific question concerns direction or a median benchmark.
  • Differences are at least ordinal, so above, below and tied are meaningful.
  • Normality of paired differences is doubtful.
  • Extreme magnitudes should not dominate the inference.
  • The difference distribution is asymmetric, weakening signed-rank assumptions.
  • An exact small-sample procedure is preferred.
  • Ties can be identified and reported explicitly.

Choose Another Method When

  • Groups are independent rather than paired.
  • The size of change is central and can be modelled credibly.
  • Repeated measures involve more than two occasions.
  • Pairs are clustered within schools, families or sites.
  • Covariate adjustment is required.
  • Binary paired outcomes call for McNemar’s test.
  • The null concerns a mean rather than a directional median tendency.
  • Ties represent an outcome category that should not be conditioned away.

Decision Flow

Step 1Are observations paired?

If no, do not use the paired sign test.

Step 2Can direction be defined?

Calculate later minus earlier or observation minus benchmark.

Step 3Can magnitude assumptions be defended?

If yes, compare the paired t test or signed-rank test; otherwise the sign test is the safer directional procedure.

For a broader method-selection discussion, see parametric versus nonparametric tests.

Sign Test Variants and Their Meanings

VariantInputDifference or deviationNull questionTypical output
Paired sign testTwo measurements per unitdi = after − beforeAre positive and negative paired changes equally likely?Positive count, negative count, ties, exact p-value
One-sample sign testOne measurement per unitdi = xi − m0Is the population median compatible with m0?Above/below counts and exact binomial p-value
One-sided sign testPaired or one-sample signsSame sign codingIs the positive-sign probability greater or less than 0.50?Single-tail exact p-value
Two-sided sign testPaired or one-sample signsSame sign codingIs the positive-sign probability different from 0.50?Two-tail exact p-value

Current Worked Variant

The current analysis is a paired, two-sided, exact sign test. G3 is treated as the later measure, G2 as the earlier measure, and ties are G3 = G2. The direction convention matters: reversing the subtraction would exchange positive and negative counts but leave the two-sided p-value unchanged.

Relationship to the One-Sample Sign Test

A paired sign test is mathematically a one-sample sign test applied to the difference scores with null median zero. The distinction is substantive: the paired version requires valid within-unit matching, whereas the one-sample version compares independent observations with a fixed benchmark.

Terminology warning: “sign test” is often confused with the Wilcoxon signed-rank test. The sign test uses only direction. The signed-rank test uses both direction and ranked absolute magnitudes and therefore requires stronger distributional reasoning.

Variables, Coding and Data Dictionary

VariableRoleCoding or rangeValid NMeaning
G2Earlier paired measurement0 to 19 in the observed data649Second-period student grade.
G3Later paired measurement0 to 19 in the observed data649Final student grade.
G3 − G2Derived paired difference−9 to +6649Magnitude and direction of within-student change.
SignTest input+ if d>0; − if d<0; tie if d=0649Direction category used by the sign test.
Non-tie indicatorExact-test filter1 if d≠0649Determines the binomial sample size n*=362.

Descriptive Paired Summary

MeasureG2G3G3 − G2
Mean11.570111.90600.3359
Median11120
Standard deviation2.91363.23071.2782
Minimum00−9
Maximum1919+6

The final-grade mean is 0.3359 points above the second-period mean, and the median rises from 11 to 12. These magnitude summaries provide context, but none of them enters the exact sign-test probability.

Why the median difference is zero: 287 zero differences span the centre of the ordered difference list. The sample median therefore equals zero even though positive signs dominate negative signs among the 362 changed pairs.

Sign Test Formula and Exact Manual Calculation

For each pair, calculate di = G3i − G2i. Define X as the number of positive differences and n* as the number of nonzero differences.

X = Σ I(di > 0),    n* = Σ I(di ≠ 0)
Under H0, X ~ Binomial(n*, 0.50)

Step 1: Classify the 649 Differences

CategoryCountShare of all pairsTest treatment
Positive: G3 > G229044.68%Counted as positive sign
Negative: G3 < G27211.09%Counted as negative sign
Tie: G3 = G228744.22%Reported, then excluded from X and n*
Total649100.00%All valid paired records

Step 2: Form the Exact Binomial Sample

n* = 290 + 72 = 362
+ = 290 / 362 = 0.8011049724

Step 3: Calculate the Two-Sided Exact Probability

Because the null distribution is symmetric around 181 positive signs, the equally extreme lower-tail count is 72. The exact two-sided probability is twice the probability of observing 72 or fewer positive signs under Binomial(362, 0.50).

p = 2 Σk=072 C(362,k)(0.5)362
p = 3.9795987705 × 10−32

Manual Calculation Audit

QuantityValueCalculation or interpretation
Positive changes, X290G3 exceeded G2.
Negative changes72G3 was below G2.
Ties287G3 equalled G2; excluded from exact binomial statistic.
Non-tied pairs, n*362290 + 72.
Observed positive proportion0.801105290 / 362.
Exact two-sided p-value3.979599 × 10−322 × P{Binomial(362,.5) ≤ 72}.

Exact Rejection Region at α = .05

The conservative equal-tail exact region is X ≤ 161 or X ≥ 201. The observed X = 290 is 89 signs beyond the upper critical boundary. The total null probability in these two tails is approximately 0.04024, reflecting the discreteness of the binomial distribution.

Null featureValue
Expected positive count181
Null standard deviation√(362 × .5 × .5) = 9.5131
Lower exact critical count161
Upper exact critical count201
Observed positive count290
Standardized distance without continuity correctionz = 11.4578

Exact Probability Versus Normal Approximation

CalculationTwo-sided probabilityUse in this post
Exact binomial3.9795987705 × 10−32Primary reported result
Normal approximation without continuity correction2.1484081657 × 10−30Diagnostic comparison only
Normal approximation with continuity correction3.9356883714 × 10−30Diagnostic comparison only
One-sided exact greater tail1.9897993853 × 10−32Valid only for a prespecified positive alternative
Probability of exactly X=2901.5002256927 × 10−32One point probability, not the complete tail

The approximations lead to the same decision but are roughly two orders of magnitude larger than the exact two-sided probability. Because an exact binomial calculation is straightforward for n*=362, the exact result should be preferred. The probability of exactly 290 positives is not the p-value; the p-value includes outcomes at least as extreme in both tails.

Exact-result check: Python and R return 3.9795987705 × 10−32. SPSS commonly prints .000 because of display precision; the report must use p < .001 rather than p = 0.

Observed Difference Distribution and Direction Tables

Complete G3 − G2 Difference Distribution

DifferenceCountPercent of 649
-920.31%
-820.31%
-730.46%
-610.15%
-510.15%
-400.00%
-340.62%
-230.46%
-1568.63%
028744.22%
123436.06%
2477.24%
381.23%
400.00%
500.00%
610.15%

Direction Counts and Proportions

DenominatorPositiveNegativeTieInterpretation
All 649 pairs290 (44.68%)72 (11.09%)287 (44.22%)Describes every student.
362 non-tied pairs290 (80.11%)72 (19.89%)ExcludedDefines the exact sign test.
Null model181 expected181 expectedConditioned outEqual direction probability among non-ties.

Magnitude Components Kept for Description

ComponentValueWhat it shows
Sum of positive differences+358Total upward points across increasing pairs.
Sum of negative differences−140Total downward points across decreasing pairs.
Net sum+218Equivalent to 649 × mean difference 0.3359.
Mean positive magnitude1.2345Most increases are one point.
Mean absolute negative magnitude1.9444Decreases are less frequent but somewhat larger on average.
Median nonzero difference+1Typical changed pair moved upward one point.

The frequency table makes the robustness trade-off visible. There are a few very large decreases, including two −9 values, two −8 values and three −7 values. A magnitude-sensitive method would give those observations more influence. The sign test gives each one a single negative sign.

Concentration Around Zero

Difference bandCountShare
Exactly 028744.22%
±129044.68%
±2507.70%
Absolute difference ≥ 3223.39%
Data pattern: 88.91% of all pairs are either tied or differ by exactly one point. The inference is therefore about a broad directional imbalance across many modest changes, not merely a handful of extreme observations.

Complete Sign Test Results and Data Interpretation

Positive signs290

80.11% of non-ties

Negative signs72

19.89% of non-ties

Exact two-sided p3.98 × 10−32

Binomial exact

Exact 95% CI for p+0.7562–0.8410

Clopper–Pearson

Directional odds4.0278

290 / 72

Net sign advantage0.6022

Positive minus negative share

Primary Inference Table

TestXn*Null pExact two-sided pDecision
Paired sign test2903620.503.9795987705 × 10−32Reject H0

Positive-Sign Probability Interval

IntervalLowerEstimateUpperMeaning
Exact 95% Clopper–Pearson0.7562080.8011050.840997The changed-pair increase probability is well above 0.50.
Wilson 95%0.7569180.8011050.838969A closely agreeing large-sample interval.
Transformed net advantage0.5124160.6022100.6819942p − 1 scale; zero would represent equal directions.

What the Result Establishes

  • The direction of change is not balanced among non-tied pairs.
  • Increases are approximately four times as frequent as decreases among changed pairs.
  • The result remains overwhelming even though nearly half the sample is tied.
  • The conclusion does not depend on normality of G3 − G2 or on the sizes of the −9, −8 and +6 changes.

What the Result Does Not Establish

  • It does not estimate a causal effect of time or instruction.
  • It does not claim every student improved.
  • It does not show that the median of the observed difference scores is above zero; that median equals zero.
  • It does not use or test the mean difference of 0.3359.
  • It does not explain why grades changed.

Directional Pattern by Starting Grade Band

The overall sign test is the primary inference, but the raw paired data also show how the direction pattern varies with the starting G2 level. These subgroup summaries are descriptive and were not used to replace or multiply the primary exact test.

Baseline G2 bandPairsPositiveNegativeTiesPositive share among non-tiesMean G3−G2Median G3−G2
G2 0–914583243877.57%0.22761
G2 10–133521473716879.89%0.35230
G2 14–1915260118184.51%0.40130

Positive signs dominate in all three broad baseline bands. The positive share among non-ties rises from 77.57% for G2 values below 10 to 84.51% for G2 values from 14 to 19. At the same time, ties become especially common in the upper band: 81 of 152 students with G2 from 14 to 19 had no grade change.

Exact Starting-Grade Audit

G2PairsPositiveNegativeTiesPositive share among non-tiesMean change
070070.0000
5321066.67%0.0000
6751183.33%0.2857
71694369.23%-0.7500
8401881469.23%0.0000
97249101383.05%0.5972
10833793780.43%0.3253
1110332145769.57%0.2136
12864933494.23%0.6977
138029114072.50%0.1875
14543032190.91%0.6667
15381612194.12%0.5000
1625611885.71%0.2000
1720711287.50%0.2500
181415816.67%-0.2857
1910010.0000

The exact-level table reveals two boundary patterns. All seven records with G2 = 0 were also G3 = 0 and therefore entered the tie count. At G2 = 18, only one pair increased while five decreased and eight tied; this local reversal is compatible with a ceiling effect because only a one-point increase to 19 is available, whereas several downward values are possible. The sign test does not model that ceiling directly, so the table is useful context rather than a causal explanation.

Why the pooled result is still meaningful: the positive imbalance is not confined to one starting-grade band. It appears in the low, middle and upper groups, although the balance at individual G2 values is affected by small counts and grade-scale boundaries.
Best substantive statement: “Among students with a changed grade, increases from G2 to G3 were substantially more common than decreases (290 versus 72; exact p < .001).”
AdvertisementGoogle AdSense placement reserved after the Results section

Sign Test Assumptions and Diagnostic Checks

Valid pairing

Each G2 value must be matched to the same student’s G3 value.

Independent pairs

One student’s change should not determine another student’s change.

Meaningful direction

Higher and lower grades must have an interpretable ordering.

Transparent ties

Zero differences must be counted and their exclusion disclosed.

Prespecified subtraction

G3 − G2 was defined before interpreting the direction.

Representative design

Population claims require appropriate sampling or design support.

Diagnostic Audit

CheckObserved evidenceAssessment
Pair completeness649 G2 values and 649 G3 valuesPass
Sign reconciliation290 + 72 + 287 = 649Pass
Non-tie reconciliation290 + 72 = 362Pass
Tie burden287 / 649 = 44.22%High; report prominently
Difference range−9 to +6Asymmetric extremes; sign test remains valid
Null expected signs181 positive and 181 negativeObserved 290 and 72 are far from null
Exact calculationPython and R agree at 3.9795987705 × 10−32Pass

Do Differences Need to Be Symmetric?

No. Symmetry is not required for the sign test because absolute magnitudes are discarded. This separates it from the Wilcoxon signed-rank test, whose usual location-shift interpretation depends on a symmetric difference distribution.

Do Differences Need to Be Normally Distributed?

No. The exact binomial null distribution governs the sign count. A normal distribution is used only if someone chooses an approximation, which is unnecessary here because the exact calculation is available.

Why Ties Matter

Ties reduce the effective exact-test sample from 649 to 362. They also change the interpretation: the test conditions on a change having occurred. When ties are common, report their number and percentage rather than presenting n*=362 as though 287 records had vanished.

Sign Test Versus Related Tests

MethodUses pairing?Uses magnitude?Key assumptionBest question
Sign testYes for paired versionNoIndependent pairs and meaningful signsAre positive and negative changes equally likely?
Paired t testYesYes, raw differencesApproximately normal mean-difference inference or adequate sample robustnessIs the mean paired difference zero?
Wilcoxon signed-rank testYesYes, ranked absolute differencesSymmetric difference distribution for location interpretationIs there a ranked location shift?
McNemar’s testYesBinary discordance onlyPaired binary outcomesDo paired binary proportions differ?
Exact binomial testNot inherentlyNoIndependent Bernoulli trialsDoes a binary event probability equal a specified value?

Sign Test Versus Paired t Test

The paired t test would test the mean difference and use the actual −9 to +6 magnitudes. It can be more efficient when the mean is the scientific target and the difference distribution supports its standard error. The sign test targets directional balance and remains resistant to extreme magnitudes.

Sign Test Versus McNemar’s Test

McNemar’s test is appropriate when each paired measurement is binary, such as pass/fail before and after. G2 and G3 are ordered numeric grades, so reducing them to “up,” “down” and “tie” leads to the sign test rather than McNemar’s discordant 2 × 2 table.

Sign Test Versus Exact Binomial Test

The sign test’s computational engine is the exact binomial test. The substantive step is creating valid signs from paired or one-sample deviations; after that, the positive count is tested against probability 0.50.

Method-selection rule: do not choose the sign test merely because another method gives a less convenient p-value. Choose it because the directional estimand and its weak distributional assumptions match the research question.

Sign Test Calculator: Step-by-Step Workflow

A reliable sign test calculator needs either raw paired values or three verified counts: positive, negative and tied differences. The current worked calculation can be reproduced without hidden steps.

InputEnter paired G2 and G3 values

Keep one student per row.

TransformCompute G3 − G2

Classify positive, negative and zero differences.

InferRun exact Binomial(n*, .5)

Use X = positive count and n* = positive + negative.

Calculator Inputs and Outputs

FieldWorked valueValidation
Positive signs290Integer from 0 to n*
Negative signs72Integer from 0 to n*
Ties287Reported but excluded from n*
AlternativeTwo-sidedSelected before viewing the result
Confidence level95%For positive-sign probability interval
Non-tie n*362290 + 72
Exact p-value3.9795987705 × 10−32Must not be rounded to zero

Excel Calculator Formulas

PurposeFormula
Difference in C5=B5-A5
Positive count=COUNTIF(C5:C653,">0")
Negative count=COUNTIF(C5:C653,"<0")
Tie count=COUNTIF(C5:C653,0)
Non-tie count=COUNTIF(C5:C653,"<>0")
Two-sided exact p=2*BINOM.DIST(MIN(Positive,Negative),NonTies,0.5,TRUE)
Display tip: format the p-value cell in scientific notation. A cell formatted with too few decimals may display 0.000 even though the underlying probability is approximately 3.98 × 10−32.

Python Sign Test Chart Interpretations

Each Python figure is interpreted from the exact worked counts. The charts support the statistical narrative but do not replace the numeric tables.

Change Directions: The Sign Count Behind the Test

Change Directions: The Sign Count Behind the Test
290 increases, 72 decreases and 287 ties are the complete directional decomposition of 649 pairs.
Exact values

290 increases, 72 decreases and 287 ties are the complete directional decomposition of 649 pairs.

Statistical meaning

Among all records, 44.68% increased, 11.09% decreased and 44.22% were tied. The bar heights reconcile exactly to 649.

Interpretation checkpoint: The chart prevents the effective n=362 from being mistaken for the original sample size. Ties are not missing data; they are observed zero changes.

Difference Distribution: Direction Dominates Despite Asymmetric Extremes

Difference Distribution: Direction Dominates Despite Asymmetric Extremes
The distribution ranges from −9 to +6, with 287 zeros, 234 +1 changes and 56 −1 changes.
Exact values

The distribution ranges from −9 to +6, with 287 zeros, 234 +1 changes and 56 −1 changes.

Statistical meaning

Most information lies near zero: 88.91% of pairs are tied or differ by one point. Large negative changes exist but are rare.

Interpretation checkpoint: The sign test intentionally prevents the two −9 and two −8 observations from dominating the inference; each contributes one negative sign.

Exact Null Distribution: Observed X = 290 Versus Expected 181

Exact Null Distribution: Observed X = 290 Versus Expected 181
Under H0, X follows Binomial(362, 0.50), with mean 181 and standard deviation 9.513.
Exact values

Under H0, X follows Binomial(362, 0.50), with mean 181 and standard deviation 9.513.

Statistical meaning

The observed count is 109 signs above the null mean, or 11.46 null standard deviations without continuity correction.

Interpretation checkpoint: The exact tail—not the normal approximation—is the reported analysis, producing p = 3.9796 × 10⁻³².

Two-Sided Region: Observed Count Far Beyond the Critical Boundary

Two-Sided Region: Observed Count Far Beyond the Critical Boundary
At a conservative exact α=.05, the rejection region is X≤161 or X≥201.
Exact values

At a conservative exact α=.05, the rejection region is X≤161 or X≥201.

Statistical meaning

X=290 lies 89 counts beyond the upper critical boundary. The visual distance explains why rounding the p-value to .000 hides substantial information.

Interpretation checkpoint: Report the scientific-notation probability or p<.001, never p=0.

Sign Proportions: 80.11% Positive Among Changed Pairs

Sign Proportions: 80.11% Positive Among Changed Pairs
The non-tied positive proportion is 0.801105 and the negative proportion is 0.198895.
Exact values

The non-tied positive proportion is 0.801105 and the negative proportion is 0.198895.

Statistical meaning

The exact 95% interval for the positive probability is 0.756208 to 0.840997, wholly above 0.50.

Interpretation checkpoint: The net directional advantage is 0.602210, and the directional odds are 4.0278 increases per decrease.

Result Summary: Strong Directional Evidence With a Zero Sample Median

Result Summary: Strong Directional Evidence With a Zero Sample Median
The summary combines X=290, n*=362, exact p≈3.98×10⁻³² and the reject decision.
Exact values

The summary combines X=290, n*=362, exact p≈3.98×10⁻³² and the reject decision.

Statistical meaning

The sample median difference is 0 because of 287 ties, while the median among nonzero differences is +1.

Interpretation checkpoint: The correct report emphasizes the conditional direction among changed pairs and retains the zero-median nuance.

AdvertisementGoogle AdSense placement reserved after Python figures

R Sign Test Charts in Paired Rows

Cross-software rule: the R figures use the same 649 pairs, G3 − G2 direction, tie exclusion and exact binomial null as the Python analysis.

R chart pair 1: Change directions and Difference distribution

R Change directions for the paired sign test
R change directions for G3 − G2.
R Difference distribution for the paired sign test
R difference distribution for G3 − G2.
Data interpretation

Direction counts

The R direction chart reproduces 290 positive, 72 negative and 287 tied pairs. It verifies that the R workflow uses the same subtraction order and tie definition as the workbook.

Values must reconcile with 290 positive, 72 negative, 287 tied and n*=362.
Data interpretation

Difference distribution

The R distribution chart confirms the modal difference is 0 and the most common nonzero difference is +1. The rare long negative tail is descriptive rather than a weighted component of the sign statistic.

Values must reconcile with 290 positive, 72 negative, 287 tied and n*=362.

R chart pair 2: Exact binomial null and Cumulative paired difference

R Exact binomial null for the paired sign test
R exact binomial null for G3 − G2.
R Cumulative paired difference for the paired sign test
R cumulative paired difference for G3 − G2.
Data interpretation

Exact null

The exact-null figure places X=290 against Binomial(362,.5). The observed count is visually detached from the probability mass centred at 181.

Values must reconcile with 290 positive, 72 negative, 287 tied and n*=362.
Data interpretation

Cumulative difference

The cumulative sequence ends at +218 grade points, reaches a maximum of +241 near pair 621 and has a minimum of −1. This order-dependent curve is descriptive and must not be confused with the order-free sign test.

Values must reconcile with 290 positive, 72 negative, 287 tied and n*=362.

R chart pair 3: Non-tie balance and Result summary

R Non-tie balance for the paired sign test
R non-tie balance for G3 − G2.
R Result summary for the paired sign test
R result summary for G3 − G2.
Data interpretation

Non-tie balance

The non-tie chart removes 287 zeros and displays the 80.11% versus 19.89% direction split used in the exact test.

Values must reconcile with 290 positive, 72 negative, 287 tied and n*=362.
Data interpretation

Result summary

The final R panel reconciles counts, exact probability and decision. Agreement with Python and Excel confirms that the analysis is not software-specific.

Values must reconcile with 290 positive, 72 negative, 287 tied and n*=362.

Sign Test in Python, R, SPSS and Excel

Python

  • Create d = G3 − G2.
  • Count d>0, d<0 and d=0.
  • Use scipy.stats.binomtest(290, 362, .5).
  • Request the exact confidence interval for the positive-sign probability.

R

  • Compute d <- G3 - G2.
  • Set x <- sum(d > 0).
  • Set n <- sum(d != 0).
  • Run binom.test(x, n, p=.5).

SPSS

  • Keep G2 and G3 as paired variables.
  • Use the paired Sign procedure under Nonparametric Tests.
  • Verify positive, negative and tie counts.
  • Report SPSS .000 as p<.001, not p=0.

Excel

  • Calculate row differences.
  • Use COUNTIF for the three direction categories.
  • Use BINOM.DIST on the smaller tail.
  • Format tiny probabilities in scientific notation.

Cross-Software Reconciliation

OutputPythonRSPSS displayExcel/verified
Positive290290290290
Negative72727272
Ties287287287287
Non-ties362362362362
Two-sided p3.9795987705E−323.9795987705E−32.0003.9795987705E−32
DecisionReject H0Reject H0Reject H0Reject H0

Software agreement depends on matching the same alternative and tie convention. Some packages label the procedure as a median test, while others expose the binomial calculation directly. The counts and null probability are the common core.

Expandable Sign Test Code

Python: exact paired sign test
import numpy as np
from scipy.stats import binomtest

g2 = np.asarray(g2_values, dtype=float)
g3 = np.asarray(g3_values, dtype=float)

if g2.shape != g3.shape:
    raise ValueError("G2 and G3 must have the same number of paired values.")

d = g3 - g2
positive = int(np.sum(d > 0))
negative = int(np.sum(d < 0))
ties = int(np.sum(d == 0))
non_ties = positive + negative

result = binomtest(
    k=positive,
    n=non_ties,
    p=0.5,
    alternative="two-sided"
)
ci = result.proportion_ci(confidence_level=0.95, method="exact")

print({
    "positive": positive,
    "negative": negative,
    "ties": ties,
    "non_ties": non_ties,
    "p_value": result.pvalue,
    "positive_probability_ci": (ci.low, ci.high),
})
R: exact paired sign test
d <- G3 - G2

positive <- sum(d > 0, na.rm = TRUE)
negative <- sum(d < 0, na.rm = TRUE)
ties <- sum(d == 0, na.rm = TRUE)
non_ties <- positive + negative

fit <- binom.test(
  x = positive,
  n = non_ties,
  p = 0.5,
  alternative = "two.sided",
  conf.level = 0.95
)

list(
  positive = positive,
  negative = negative,
  ties = ties,
  non_ties = non_ties,
  p_value = fit$p.value,
  confidence_interval = fit$conf.int
)
SPSS: paired sign test syntax
NPAR TESTS
  /SIGN = G3 WITH G2 (PAIRED)
  /MISSING ANALYSIS.

Check that the output direction matches G3 minus G2. If the variable order is reversed, positive and negative labels reverse while the two-sided probability remains unchanged.

Excel: transparent formulas
C5: =B5-A5
Positive: =COUNTIF(C5:C653,">0")
Negative: =COUNTIF(C5:C653,"<0")
Ties: =COUNTIF(C5:C653,0)
NonTies: =Positive+Negative
TwoSidedP: =2*BINOM.DIST(MIN(Positive,Negative),NonTies,0.5,TRUE)
One-sample sign test adaptation
# Compare observations x with hypothesised median m0
d = x - m0
positive = sum(d > 0)
negative = sum(d < 0)
result = binomtest(positive, positive + negative, p=0.5)
One-sided positive-change alternative
# Python
binomtest(290, 362, p=0.5, alternative="greater")

# R
binom.test(290, 362, p=0.5, alternative="greater")

The one-sided exact p-value is 1.9897993853 × 10−32. A one-sided alternative must be prespecified rather than selected after observing 290 positive signs.

How to Interpret and Report the Sign Test

APA-Style Worked Report

An exact two-sided paired sign test examined the direction of change from second-period grade (G2) to final grade (G3) for 649 students. There were 290 positive differences, 72 negative differences and 287 ties, leaving 362 non-tied pairs for the exact binomial test. Positive changes constituted 80.11% of non-tied pairs, 95% exact CI [75.62%, 84.10%]. The direction distribution differed significantly from equal positive and negative probabilities, exact p < .001. Thus, among students whose grade changed, increases were substantially more common than decreases.

Reporting Table

ItemReport
DesignPaired exact sign test
Difference definitionG3 − G2
Positive / negative / ties290 / 72 / 287
Effective n362 non-tied pairs
Positive proportion0.8011
Exact 95% CI[0.7562, 0.8410]
Exact two-sided p3.9796 × 10−32; report p<.001
Observed median difference0
Interpretive scopeDirectional imbalance among non-tied pairs
Reusable templates:Replace the highlighted fields while preserving the tie count, effective sample size and direction convention.

Significant Two-Sided Result

Significant

Method

An exact paired sign test compared later measure with earlier measure.

Counts

There were X positive, Y negative and T tied differences.

Inference

The positive-sign proportion was , exact 95% CI [lower, upper], exact p value.

Non-Significant Result

Not significant

Conclusion

The observed positive and negative directions did not provide sufficient evidence against equal sign probabilities, exact p = value.

Precision

The exact confidence interval for the positive-sign probability was [lower, upper].

Prespecified One-Sided Result

Directional

Alternative

A prespecified one-sided sign test evaluated whether positive changes were more likely than negative changes.

Result

Positive changes occurred in X of n* non-tied pairs, exact one-sided p value.

Never write p = .000: software display rounding is not a mathematical zero. Use p < .001 in conventional prose or provide the verified scientific-notation probability.

Common Sign Test Mistakes and Corrections

MistakeWhy it is wrongCorrection
Using 649 as the binomial nTies do not contribute positive or negative signs.Use n*=290+72=362 and report 287 ties separately.
Reporting p=0The exact probability is tiny but positive.Report p<.001 or 3.9796×10−32.
Claiming the sample median difference is positiveThe observed median difference is exactly 0.Describe the positive imbalance among non-tied pairs.
Reversing the subtraction silentlyIt changes which direction is labelled positive.State d=G3−G2 before analysis.
Calling the test WilcoxonThe sign test does not rank magnitudes.Name the exact paired sign test.
Ignoring pairingIndependent-sample analysis discards within-student matching.Compute one difference per student.
Deleting ties as missing dataA tie is an observed outcome, not missingness.Show the tie count and percentage.
Using a one-sided p after seeing the dataThat inflates selective-inference risk.Prespecify the directional alternative.
Interpreting association as causationThe test does not identify a cause of change.Limit conclusions to observed directional evidence.
Focusing only on significanceA huge sample can produce small p-values.Report 80.11%, its interval, ties and direction odds.

Quality-Control Checklist

Counts reconcile290 + 72 + 287 = 649
Effective n reconciles290 + 72 = 362
Direction documentedG3 − G2
Exact p retained3.9796E−32
Ties disclosed44.22% of all pairs
Median nuance retainedObserved median difference = 0

Sign Test Practice Questions With Solutions

1. Recalculate the effective sample size

A paired study has 41 positive changes, 19 negative changes and 20 ties. What is n*?

Solution: n* = 41 + 19 = 60. The 20 ties are reported but excluded from the exact binomial statistic.

2. Choose the correct tail

A protocol specified before data collection that the later score would be higher. Which alternative should be used?

Solution: Use a one-sided greater alternative, p+>0.50. Do not choose it after seeing the observed direction.

3. Interpret a zero median with many ties

Suppose the sample median difference is zero, but 90 of 110 non-tied pairs are positive. Is a sign test meaningful?

Solution: Yes. The conditional exact test evaluates whether positive and negative directions are balanced among non-ties. The report must state that the overall sample median is zero and that ties were excluded.

4. Distinguish sign test from paired t test

Which method uses the actual sizes of the paired differences?

Solution: The paired t test uses raw difference magnitudes. The sign test uses only direction.

5. Interpret the current result

What does 290 positive versus 72 negative changes establish?

Solution: Among the 362 changed pairs, increases were much more likely than decreases. It does not prove why the changes occurred or that every student improved.

6. Check the current exact count

Under H0 with n*=362, what is the expected number of positive signs?

Solution: 362×0.50=181. The observed count of 290 is 109 above this expectation.

Sign Test Reports and Worked Files

The downloadable files reproduce the same G3 − G2 direction, counts and exact inference. Use the workbook to inspect every paired difference and formula.

Download Verification

FileExpected core values
Python reportPositive 290; negative 72; ties 287; exact p 3.9795987705E−32
R reportSame counts, exact binomial result and confidence interval
SPSS outputPaired Sign procedure; p displayed as .000 because of print precision
Excel workbook649 raw pairs, formulas, difference table, diagnostics and reporting audit

Sign Test Frequently Asked Questions

What is a sign test?

A sign test is an exact or approximate nonparametric procedure that counts positive and negative deviations from a benchmark. In paired data, the deviations are within-pair differences.

What is the sign test formula?

After removing ties, let X be the number of positive signs and n* the number of non-ties. Under the usual null, X follows Binomial(n*,0.50).

Why are ties excluded?

A zero difference is neither positive nor negative, so it provides no direction. Ties must still be reported because they describe the data and reduce the effective sample size.

What were the worked counts?

The 649 pairs contained 290 increases, 72 decreases and 287 ties. The exact test therefore used n*=362.

What was the exact p-value?

The exact two-sided probability was 3.9795987705×10⁻³². In conventional reporting this is p<.001.

Can the median difference be zero when the sign test is significant?

Yes. Here 287 ties force the observed median difference to zero, while 290 of 362 non-tied differences are positive. The test detects conditional directional imbalance.

Is the sign test the same as Wilcoxon signed-rank?

No. The sign test uses only direction. Wilcoxon signed-rank uses direction and ranked absolute differences.

Does the sign test require normality?

No. Its exact null distribution is binomial.

Does the sign test require symmetry?

No. Symmetry is not required because magnitudes are discarded.

What does the positive-sign confidence interval mean?

The exact 95% interval of 0.7562 to 0.8410 estimates the probability that a changed pair is positive, conditional on the difference being nonzero.

Can Excel perform a sign test?

Yes. Use formulas to count positive, negative and tied differences, then calculate the exact binomial tail with BINOM.DIST.

How should SPSS .000 be reported?

Report p<.001, not p=.000 and not p=0.

Sign Test Conclusion

The exact paired sign test provides a clear directional result for the 649 G2–G3 pairs. Of the 362 students whose grade changed, 290 increased and 72 decreased. The positive-sign proportion was 0.8011, with an exact 95% confidence interval from 0.7562 to 0.8410, and the two-sided exact probability was approximately 3.98 × 10−32.

The strongest interpretation is also the most precise: among changed pairs, grade increases were far more common than decreases. The analysis does not require normality or symmetry, does not allow rare extreme magnitudes to dominate, and does not conceal the 287 ties. Because those ties make the observed median difference equal to zero, a high-quality report should describe the directional imbalance rather than claiming a positive observed median.

The worked Python, R, SPSS and Excel files all reconcile to the same counts and decision. Readers can use the formulas, code and reporting templates above to reproduce the sign test for paired data or adapt it to a one-sample median benchmark.

Back to top

Need help applying this to your own data?

Salar Cafe can help interpret output, clean datasets, review assumptions, build dashboards and explain statistical results ethically.

Need help interpreting your data analysis results?

Contact Salar Cafe
Engr. Muhammad Yar Saqib author profile photo

Engr. Muhammad Yar Saqib

WhatsApp Get Data Analysis Help