Algorithm Search⌘K

Definitionintro

Type I and type II errors

Also called false rejection and false acceptance, alpha and beta errors.

A type I error rejects a true null hypothesis and a type II error keeps a false one. The size of a test bounds the first; its power is one minus the second.

A type I error is the rejection of a null hypothesis H0H_0 that is true; a type II error is the failure to reject H0H_0 when it is false. The two names come from Neyman and Pearson's 1933 theory of statistical hypothesis tests, in which a test is designed to keep the probability of the first below a level α\alpha and, subject to that, to make the probability of the second as small as possible. For a fixed amount of data the two error probabilities pull against each other: a test that rejects less often makes fewer type I errors and more type II errors.

Definition

Let XX have a distribution PθP_\theta with θ∈Θ\theta \in \Theta, let H0:θ∈Θ0H_0: \theta \in \Theta_0 and H1:θ∈Θ1H_1: \theta \in \Theta_1 with Θ0∩Θ1=∅\Theta_0 \cap \Theta_1 = \emptyset, and let a test reject H0H_0 exactly when XX falls in a rejection region RR. Its power function is π(θ)=Pθ(X∈R)\pi(\theta) = P_\theta(X \in R).

H0H_0 true (θ∈Θ0\theta \in \Theta_0) H1H_1 true (θ∈Θ1\theta \in \Theta_1)
reject H0H_0 type I error, probability π(θ)\pi(\theta) correct, probability π(θ)\pi(\theta) (the power)
do not reject H0H_0 correct, probability 1−π(θ)1 - \pi(\theta) type II error, probability β(θ)=1−π(θ)\beta(\theta) = 1 - \pi(\theta)
  • The type I error probability at θ∈Θ0\theta \in \Theta_0 is π(θ)\pi(\theta).
  • The size of the test is sup⁡θ∈Θ0π(θ)\sup_{\theta \in \Theta_0}\pi(\theta), the largest type I error probability. The test has level α\alpha when its size is at most α\alpha.
  • The type II error probability at θ∈Θ1\theta \in \Theta_1 is β(θ)=1−π(θ)\beta(\theta) = 1 - \pi(\theta). It is a function of the alternative, not one number: it is close to one minus the size, which is at least 1−α1 - \alpha, for alternatives near Θ0\Theta_0 and goes to 0 for alternatives far from it.

The probabilities are frequentist: they are over repeated data with θ\theta held fixed. For a randomized test ϕ(X)∈[0,1]\phi(X) \in [0, 1], the rejection probability is π(θ)=Eθ[ϕ(X)]\pi(\theta) = E_\theta[\phi(X)] and the same definitions apply.

Examples and non-examples

A coin, and the trade-off. X∼Binomial(20,p)X \sim \text{Binomial}(20, p), H0:p=1/2H_0: p = 1/2 against H1:p>1/2H_1: p > 1/2, rejecting for X≥kX \ge k. The exact binomial sums are:

kk type I error P1/2(X≥k)P_{1/2}(X \ge k) type II error at p=0.6p = 0.6 type II error at p=0.7p = 0.7
13 0.1316 0.5841 0.2277
14 0.0577 0.7500 0.3920
15 0.0207 0.8744 0.5836
16 0.0059 0.9490 0.7625
17 0.0013 0.9840 0.8929

Raising kk lowers the type I error and raises the type II error. The smallest kk with level 0.05 is 15, whose size is 0.0207, and against p=0.6p = 0.6 it misses 87% of the time. Only more data lowers both at once.

A medical screening analogy. With H0H_0 "the patient is healthy", a type I error is a false positive and a type II error a false negative; 1−α1 - \alpha is the specificity and the power is the sensitivity.

Non-example: the p-value. A p-value of 0.03 is not "a 3% chance of a type I error". The type I error probability is a property of the rule, fixed before the data: for the rule "reject if p≤0.05p \le 0.05" it is 0.05 (or less), whatever pp is observed. The p-value is a statistic computed from the data.

Non-example: the probability that a rejection is wrong. α\alpha is P(reject∣H0 true)P(\text{reject} \mid H_0 \text{ true}), not P(H0 true∣reject)P(H_0 \text{ true} \mid \text{reject}). Among 1000 tests at α=0.05\alpha = 0.05 of which 900 nulls are true and 100 have power 0.8, the expected counts are 45 false rejections and 80 true ones, so 36% of the rejections are type I errors. The share depends on how many nulls are true, which the test does not control; the false discovery rate is the error rate built for this question.

Non-example: "accepting" H0H_0. Not rejecting is not a proof of H0H_0. With power 0.13 at p=0.6p = 0.6 (the k=15k = 15 test above), a coin with p=0.6p = 0.6 gives a non-significant result 87% of the time.

  • Power is 1−β(θ)1 - \beta(\theta) on the alternative; the power function π(θ)\pi(\theta) covers both hypotheses.
  • Unbiased test. A test with π(θ)≤α\pi(\theta) \le \alpha on Θ0\Theta_0 and π(θ)≥α\pi(\theta) \ge \alpha on Θ1\Theta_1: the probability of rejecting is never smaller under a false null than under a true one.
  • Most powerful test. Among level-α\alpha tests, one with the smallest type II error at a given alternative; the Neyman-Pearson lemma finds it for simple hypotheses, and a uniformly most powerful test minimizes it at every alternative at once.
  • Family-wise error rate. For many tests, the probability of at least one type I error.
  • False discovery rate. The expected share of type I errors among the rejections.
  • Directional error. Rejecting a two-sided null and then concluding the wrong sign of the effect; some authors call it a type III error, a name that is also used for other mistakes and has no single meaning.

References

  1. J. Neyman and E. S. Pearson, On the problem of the most efficient tests of statistical hypotheses, Philosophical Transactions of the Royal Society A 231, 1933, pp. 289 to 337, The introduction (the two sources of error, rejecting a true hypothesis and accepting a false one, and the control of the first while minimizing the second)
  2. George Casella and Roger L. Berger, Statistical Inference, second edition, Duxbury, 2002, Section 8.3.1 (error probabilities and the power function, the definitions of type I and type II error, size and level)

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/YNRN9V/text.yaml