Algorithm Search⌘K

Definitionintro

P-value

Also called observed significance level.

The probability, under the null hypothesis, of a test statistic at least as extreme as the one observed. Rejecting when it is at most alpha gives a level-alpha test.

The p-value of a statistical hypothesis test is the probability, computed under the null hypothesis H0H_0, of a test statistic at least as extreme as the one observed. Small values mean that the data would be unusual if H0H_0 were true. It is valid in a precise sense: under H0H_0, the probability that it is at most uu is at most uu, so the rule "reject when p≤αp \le \alpha" has level α\alpha for every α\alpha at once. It is uniform on [0,1][0, 1] under a simple null with a continuous statistic and stochastically larger than uniform for a discrete one. It is not the probability that H0H_0 is true.

Definition

Let T(X)T(X) be a test statistic whose large values are evidence against H0:θ∈Θ0H_0: \theta \in \Theta_0, and let t=T(x)t = T(x) be its observed value. The p-value is

p(x)=sup⁡θ∈Θ0Pθ(T(X)≥t).p(x) = \sup_{\theta \in \Theta_0} P_\theta\big(T(X) \ge t\big).

For a simple null Θ0={θ0}\Theta_0 = \{\theta_0\} this is Pθ0(T≥tobs)P_{\theta_0}(T \ge t_{\text{obs}}). For a two-sided test with a statistic whose null law is symmetric about 0, it is Pθ0(∣T∣≥∣t∣)P_{\theta_0}(|T| \ge |t|), twice the one-sided tail. For an asymmetric discrete null law there are several two-sided rules (doubling the smaller tail, or summing the probabilities of outcomes no more likely than the observed one), and they can differ.

Validity. For every θ∈Θ0\theta \in \Theta_0 and every u∈[0,1]u \in [0, 1], Pθ(p(X)≤u)≤uP_\theta(p(X) \le u) \le u.

Proof. Fix θ∈Θ0\theta \in \Theta_0 and let G(s)=Pθ(T≥s)G(s) = P_\theta(T \ge s), which is non-increasing in ss. Since p(X)≥G(T(X))p(X) \ge G(T(X)), it suffices to show Pθ(G(T)≤u)≤uP_\theta(G(T) \le u) \le u. The set {s:G(s)≤u}\{s : G(s) \le u\} is an interval going to +∞+\infty with left end s∗s^*. If it contains s∗s^*, then {G(T)≤u}={T≥s∗}\{G(T) \le u\} = \{T \ge s^*\}, whose probability is G(s∗)≤uG(s^*) \le u. If not, then {G(T)≤u}={T>s∗}\{G(T) \le u\} = \{T > s^*\}, whose probability is lim⁡s↓s∗G(s)≤u\lim_{s \downarrow s^*}G(s) \le u. □\square

Uniform when continuous. If Θ0={θ0}\Theta_0 = \{\theta_0\} and TT has a continuous distribution under θ0\theta_0, then GG is continuous and P(G(T)≤u)=uP(G(T) \le u) = u for all uu: the p-value is exactly uniform on [0,1][0, 1], and the test "reject when p≤αp \le \alpha" has size exactly α\alpha. If TT is discrete, pp takes finitely or countably many values and P(p≤u)<uP(p \le u) < u for most uu: the p-value is stochastically larger than uniform, and the test is conservative.

Monte Carlo p-value. If the null law of TT cannot be computed but can be sampled, draw T1∗,…,Tb∗T_1^*, \dots, T_b^* independently from it and use

p^=1+#{i:Ti∗≥t}1+b.\hat p = \frac{1 + \#\{i : T_i^* \ge t\}}{1 + b} .

Under a simple null, T,T1∗,…,Tb∗T, T_1^*, \dots, T_b^* are b+1b + 1 exchangeable values, so the rank of TT among them is uniform (with ties broken against rejection) and P(p^≤u)≤uP(\hat p \le u) \le u exactly, for every bb. The version without the two 1s can be 0 and is not valid.

Examples and non-examples

A continuous statistic. Nine packs from a machine set to 500 g, with known σ=4\sigma = 4 g, have mean 4525/9=502.784525/9 = 502.78 g, so the z-test statistic is z=25/12=2.0833z = 25/12 = 2.0833. The two-sided p-value is 2P(Z≥2.0833)=0.0372212P(Z \ge 2.0833) = 0.037221 and the one-sided p-value for H1:μ>500H_1: \mu > 500 is 0.018610.

A discrete statistic. With X∼Binomial(10,1/2)X \sim \text{Binomial}(10, 1/2) under H0H_0 and H1:p>1/2H_1: p > 1/2, the p-value P1/2(X≥x)P_{1/2}(X \ge x) takes the values 0.3770, 0.1719, 0.0547, 0.0107 and 0.000977 at x=6,7,8,9,10x = 6, 7, 8, 9, 10 (exact sums). So P(p≤0.05)=P(X≥9)=0.0107P(p \le 0.05) = P(X \ge 9) = 0.0107, far below 0.05: the test "reject when p≤0.05p \le 0.05" has size 0.0107. The exact binomial test has this property at every nn.

The p-value mixes the effect and the sample size. A one-sample z-test of a mean shifted by 0.01σ0.01\sigma with n=106n = 10^6 gives z=10z = 10 and p=1.5×10−23p = 1.5 \times 10^{-23}; a shift of 0.5σ0.5\sigma with n=10n = 10 gives z=1.581z = 1.581 and p=0.114p = 0.114. For a two-sample t-test with the same sample effect size d=0.3d = 0.3 and nn per group (so t=0.3n/2t = 0.3\sqrt{n/2} with 2n−22n - 2 degrees of freedom), the two-sided p-value is 0.511 at n=10n = 10, 0.137 at n=50n = 50, 0.0029 at n=200n = 200 and 2.6×10−112.6 \times 10^{-11} at n=1000n = 1000.

Non-example: the probability that H0H_0 is true. pp is computed assuming H0H_0; it is P(data this extreme∣H0)P(\text{data this extreme} \mid H_0), not P(H0∣data)P(H_0 \mid \text{data}). The second needs a prior probability for H0H_0 and is a Bayesian quantity; with a Bayes factor the two can disagree sharply, most of all at large nn (Lindley's paradox).

Non-example: the type I error rate. The level α\alpha of the rule is fixed before the data. Reporting "p=0.003p = 0.003, so the error rate is 0.3%" mixes a property of the data with a property of the procedure.

Non-example: evidence for the null. p=0.4p = 0.4 does not show that H0H_0 is true: with low power, a real effect gives large p-values most of the time. "Not significant" is not "no effect".

The ASA statement of 2016 (Wasserstein and Lazar) puts two of these points as principles: "A p-value, or statistical significance, does not measure the size of an effect or the importance of a result", and "By itself, a p-value does not provide a good measure of evidence regarding a model or hypothesis."

  • Significance level. The threshold α\alpha fixed in advance; the test rejects when p≤αp \le \alpha. The p-value is the smallest level at which the observed data would lead to rejection, hence the name observed significance level.
  • Mid-p-value. For a discrete statistic, P(T>t)+12P(T=t)P(T > t) + \tfrac12 P(T = t). It is closer to uniform on average but is not valid in the sense above.
  • Adjusted p-values. In multiple testing, p-values modified so that comparing them with α\alpha controls a family-wise error rate or a false discovery rate.
  • E-variable. A nonnegative statistic with expectation at most 1 under H0H_0. By Markov's inequality min⁡(1,1/E)\min(1, 1/E) is a valid p-value, and e-variables can be multiplied across independent studies and monitored continuously.
  • Combining p-values. For independent tests with continuous statistics, Fisher's method uses −2∑log⁡pi-2\sum\log p_i, which is chi-square with 2k2k degrees of freedom under all the nulls.

References

  1. Ronald A. Fisher, Statistical Methods for Research Workers, Oliver and Boyd, 1925, online text of the first edition, Chapter III, section 12 (P as the probability of a deviation at least as large, and the 5% point)
  2. George Casella and Roger L. Berger, Statistical Inference, second edition, Duxbury, 2002, Section 8.3.4 (p-values, the definition of a valid p-value and the theorem that the tail probability is valid)
  3. Larry Wasserman, All of Statistics, Springer, 2004, Section 10.2 (p-values, their interpretation and their uniform distribution under the null)
  4. Ronald L. Wasserstein and Nicole A. Lazar, The ASA statement on p-values: context, process, and purpose, The American Statistician 70(2), 2016, pp. 129 to 133, The six principles on the use and interpretation of p-values

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/MZX1D5/text.yaml