P-values and misinterpretation
p 值与统计误读
Compute exact tail probabilities without reversing the conditioning or overlooking the design.
p-valuesAsk how the data compare with a specified null model
A process succeeds nine times in ten trials. Is that unusual under a fixed 50% success model? The answer depends on what “unusual” means. If the planned question is whether the success rate is larger, outcomes with nine or ten successes are at least as extreme. If either direction matters, very few successes also count as extreme.
A p-value summarizes this comparison. It does not assign a posterior probability to the null hypothesis, measure the size of an effect or decide whether a result matters in practice. The ASA’s statement makes these distinctions central to responsible interpretation.
Read hypothesis testing and binomial distributions first. This chapter uses an exact simple null with no fitted nuisance parameters.
Specify the statistic and direction before seeing the result
For a statistic T whose larger values are more incompatible with H₀, an exact tail p-value is:
The probability is computed under the null sampling model, including the experimental design. It is not Pr(H₀|data). Reversing that conditioning requires a different inferential construction, such as a prior and likelihood in Bayesian analysis.
Assume ten independent Bernoulli trials with common success probability 1/2. Under H₀, the probability of exactly k successes is:
The NIST Binomial reference gives the distribution’s assumptions and probability mass function. For the prespecified larger-success question, K≥9 has probability (10+1)/1024=11/1024. The probability of exactly nine is only 10/1024. A point probability omits more extreme outcomes and is not this tail p-value.
A two-sided definition needs an extremeness rule
For this symmetric null, define T=|K−n/2|. At n=10, k=9, the equally or more distant counts are 0,1,9,10. Their probability is 22/1024=11/512. This is our distance-based two-sided test. Discrete or asymmetric models can admit other two-sided conventions; do not apply a universal “double whichever p-value looks convenient” rule.
Calibration is a repeated-sampling property
A valid p-value obeys:
For the exact right-tail test, smaller p-values correspond to nested upper-tail rejection regions. Selecting a region with tail probability at most α produces the stated bound. Discreteness can make the inequality strict. Here, at α=0.05, rejection starts at nine successes: eight gives 56/1024, slightly above 0.05. The actual null rejection probability is 11/1024, much less than the nominal threshold.
This calibration does not say that every rejected null has probability at most α of being true. It describes how often the procedure rejects when the null sampling model generates repeated data.
Compute exact tails and the actual test size
Run the complete Python 3.12 standard-library program. It supports 1–100 fixed trials under the fair Bernoulli null, integer counts and rational significance thresholds. Fractions keep event probabilities and threshold comparisons exact. The code reports right-tail, distance-based two-sided and point probabilities separately.
from fractions import Fraction as F
from math import comb
def fair_masses(n):
if type(n) is not int or not 1 <= n <= 100:
raise ValueError('integer trial count in [1,100] required')
return [F(comb(n,k),2**n) for k in range(n+1)]
def pvalues(n,k):
masses=fair_masses(n)
if type(k) is not int or not 0 <= k <= n:
raise ValueError('integer success count in [0,n] required')
right=sum(masses[k:],F(0))
two=sum((p for j,p in enumerate(masses) if abs(2*j-n)>=abs(2*k-n)),F(0))
return right,two,masses[k]
def null_size(n,alpha):
masses=fair_masses(n)
if type(alpha) not in (int,F) or not 0 <= alpha <= 1:
raise ValueError('rational alpha in [0,1] required')
return sum((mass for k,mass in enumerate(masses)
if pvalues(n,k)[0]<=alpha),F(0))
if __name__ == '__main__':
right,two,point=pvalues(10,9)
print('right-tail p:',right)
print('distance-based two-sided p:',two)
print('probability of exactly nine:',point)
print('actual right-tail size at alpha=0.05:',null_size(10,F(1,20)))
print('right-tail p for eight successes:',pvalues(10,8)[0])
Output:
right-tail p: 11/1024
distance-based two-sided p: 11/512
probability of exactly nine: 5/512
actual right-tail size at alpha=0.05: 11/1024
right-tail p for eight successes: 7/128
The last value is 7/128, above 1/20. Thus eight successes do not enter the 5% right-tail rejection region, while nine do. Enumerating all possible counts checks the procedure’s actual null rejection rate rather than interpreting the observed p-value as a probability about a hypothesis.
One tail calculation sums O(n) masses. The simple calibration helper recomputes tails for all n+1 counts, using O(n²) arithmetic apart from binomial coefficient and rational bit costs. A cumulative-tail array can reduce repeated work; the tiny implementation favors an explicit definition.
A correct formula can be applied to the wrong procedure
Choosing the direction after inspecting the result, repeatedly trying outcomes or stopping when significance appears changes the sampling procedure. The single prespecified test’s calibration does not automatically cover those choices. Multiple testing and sequential methods address different versions of that problem.
A large p-value is not evidence that an effect is exactly zero. A small p-value is not an effect-size estimate: a tiny effect with precise measurements can produce a small value. Report the estimated effect, relevant uncertainty and design assumptions alongside the test result. See statistical power.
Dependence between trials, changing success probabilities or selection of observations can invalidate the binomial model. A numerical p-value does not diagnose these violations. The ASA statement also emphasizes full reporting and reasoning beyond a single threshold.
Keep the conditioning direction straight
- Why is 10/1024 not the right-tail p-value for nine successes out of ten?
Answer 1: It counts only exactly nine. Ten successes are more extreme in the planned direction and contribute another 1/1024.
- What is the distance-based two-sided p-value here?
Answer 2: 11/512, from counts 0,1,9,10 under the symmetric fair-trial null.
- Does p=11/1024 mean the null has probability 11/1024 of being true?
Answer 3: No. It is a tail probability of data under the null model, not a posterior probability of that model.
- Why is the actual false-rejection rate below 0.05?
Answer 4: Available binomial tail probabilities are discrete. Including eight successes would exceed 0.05, so the largest allowed upper rejection region starts at nine and has probability 11/1024.
Use the test as one part of the evidence
NIST supplies the sampling distribution and ASA clarifies interpretation. Exact enumeration makes the null calibration visible without relying on an asymptotic approximation or a software label.
For a project, compare one-sided and explicitly defined two-sided rejection regions across several sample sizes. Report their actual sizes and power against chosen alternatives. Keep the testing question fixed before generating each experiment.
Make a prediction, then check
Does a p-value give the probability that the null hypothesis is true?
Learning objectives
- Define extremeness and compute exact tail probabilities.
- Separate null calibration from hypothesis probability and effect size.
Prerequisites & connections
Explore related knowledge →References
- ASA release: Statement on Statistical Significance and P-Values
American Statistical Association · 2016 - NIST/SEMATECH e-Handbook — Binomial Distribution
NIST and SEMATECH
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Codex · 2026-09-06 · Codex single-agent authored technical review: primary-source locations, explicit assumptions, derivations, exact/literal and numerical checks, and bilingual review; not independent human or second-agent peer review.
- Single-agent authored technical review: primary-source locations, explicit domains and assumptions, derivations, literal/exact probability or numerical reference cases, bilingual examples and exercises. Not independent human or second-agent review.
- Four focused tests passed on CPython3.12.4; NumPy1.26.4 actually executed for the Fourier chapter. Exact rational probability/stencil checks are distinguished from floating-point calculations and observed Monte Carlo output. Both languages render three equations, six anchors and four answers; final repository checks recorded separately.
- Promoted the full prose, equations, code and exercises. Tests read formal MDX only; removed temporary fallbacks/draft skips and updated review assertion to checked. Algorithm and independent references are unchanged; final record binds both locale hashes.
- Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.
Source locations checked:
- ASA release: Statement on Statistical Significance and P-Values · 2016 ASA release: p-values do not measure hypothesis truth or effect size; reporting and threshold interpretation.
- NIST/SEMATECH e-Handbook — Binomial Distribution · Binomial mass function and fixed-trial/common-probability model; exact right and distance-based two-sided tails independently enumerated.
Related topics