Let X‾\underline{X} be a random sample of size nn from the population PX; θ\mathbb{P}_{X;\,\theta} with parameter space Θ.\Theta. A hypothesis HH is a statement about the true value of θ.\theta.

Let HH be a hypothesis. The hypothesis HH is a simple hypothesis if and only if it assigns a single value to θ,\theta, so that it fully specifies the population PX; θ.\mathbb{P}_{X;\,\theta}. The hypothesis HH is a composite hypothesis if and only if it states that θ\theta takes a value in a set containing more than one value.

Let Θ0\Theta_0 and Θ1\Theta_1 be a partition of the parameter space Θ\Theta into two complementary regions, so that Θ0∩Θ1=∅\Theta_0\cap\Theta_1=\varnothing and Θ0∪Θ1=Θ.\Theta_0\cup\Theta_1=\Theta. The null hypothesis is the hypothesis H0:θ∈Θ0.H_0:\theta\in\Theta_0. The alternative hypothesis is the hypothesis H1:θ∈Θ1.H_1:\theta\in\Theta_1.

Let H0H_0 be a null hypothesis and g:Sn→Rg:S^n\rightarrow\mathbb{R} be a function. A test statistic is a statistic T=g(X‾)T=g\left(\underline{X}\right) whose sampling distribution is known under the null hypothesis. The observed test statistic is the realised value t=g(x‾)t=g\left(\underline{x}\right) at an observed random sample x‾.\underline{x}.

Let H0H_0 and H1H_1 be null and alternative hypotheses and TT be a test statistic. A hypothesis test is a rule that rejects H0H_0 if and only if the observed test statistic lies in a specified set of values. A hypothesis test proceeds as follows:

  1. the null hypothesis is assumed to be true and a test statistic TT is chosen whose sampling distribution is known under H0;H_0;
  2. if the observed test statistic tt lies sufficiently far into the tails of the sampling distribution of TT then the observed data are judged sufficiently unlikely under H0H_0 and H0H_0 is rejected.

Hypothesis tests have the following properties:

  • the only decisions are rejecting or not rejecting H0,H_0, and H0H_0 is never accepted;
  • failing to reject H0H_0 is not evidence that H0H_0 is true, since when nn is small or the true value of θ\theta lies in Θ1\Theta_1 close to Θ0\Theta_0 the sampling distributions of TT under H0H_0 and H1H_1 overlap heavily and tt is likely to fail to lie far enough into the tails even though H0H_0 is false.

Let H0H_0 be a null hypothesis, TT be a test statistic and α∈(0,1).\alpha\in\left(0,1\right). A critical region of size α\alpha is a set CαC_{\alpha} of values of TT in the tails of its sampling distribution such that the largest probability under H0H_0 that TT lies in CαC_{\alpha} is α.\alpha.

sup⁡θ∈Θ0Pθ(T∈Cα)=α\sup_{\theta\in\Theta_0}\mathbb{P}_{\theta}\left(T\in C_{\alpha}\right)=\alpha

For a simple null hypothesis the supremum is the single probability P(T∈Cα∣H0)=α.\mathbb{P}\left(T\in C_{\alpha}\mid H_0\right)=\alpha. The hypothesis test with critical region CαC_{\alpha} rejects H0H_0 if and only if t∈Cα.t\in C_{\alpha}.

Let TT be a test statistic. A two-sided test is a hypothesis test whose critical region lies in both the upper and lower tails of the sampling distribution of T.T. A one-sided test is a hypothesis test whose critical region lies in one tail of the sampling distribution of T,T, which is identified from the alternative hypothesis. For example, H1:θ>θ0H_1:\theta>\theta_0 leads to a critical region in the upper tail.

Let H0H_0 be a null hypothesis, TT be a test statistic and tt be the observed test statistic. The pp-value of the observed random sample is the probability under H0H_0 that the test statistic takes a value at least as extreme as t.t.

  • For a one-sided test in the upper tail, p=P(T≥t∣H0).p=\mathbb{P}\left(T\geq t\mid H_0\right).
  • For a one-sided test in the lower tail, p=P(T≤t∣H0).p=\mathbb{P}\left(T\leq t\mid H_0\right).
  • For a two-sided test with a sampling distribution of TT under H0H_0 that is symmetric about zero, p=P(∣T∣≥∣t∣∣H0).p=\mathbb{P}\left(\lvert T\rvert\geq \lvert t\rvert\mid H_0\right). Otherwise a common choice is p=2min⁡{P(T≥t∣H0),P(T≤t∣H0)}.p=2\min\left\{\mathbb{P}\left(T\geq t\mid H_0\right),\mathbb{P}\left(T\leq t\mid H_0\right)\right\}.

A small pp-value corresponds to a value of tt that is unlikely under H0H_0 and indicates that the data and H0H_0 are inconsistent. If the test statistic has a continuous distribution then under a simple null hypothesis the pp-value is a U(0,1)\mathrm{U}\left(0,1\right) random variable by the probability integral transform, and rejecting when p≤αp\leq\alpha is a test of size α.\alpha.

Let H0H_0 be a null hypothesis and CαC_{\alpha} be a critical region of size α.\alpha. A type I error is the rejection of H0H_0 when H0H_0 is true. The probability of a type I error is the size α\alpha of the test.

α=P(Type I error)=P(Reject H0∣H0 is true)\alpha=\mathbb{P}\left(\mathrm{Type}\,\mathrm{I}\,\mathrm{error}\right)=\mathbb{P}\left(\mathrm{Reject}\,H_0\mid H_0\,\mathrm{is}\,\mathrm{true}\right)

Let H0H_0 and H1H_1 be null and alternative hypotheses and CαC_{\alpha} be a critical region. A type II error is the failure to reject H0H_0 when H1H_1 is true. The probability of a type II error is written β.\beta.

Let H0H_0 and H1H_1 be null and alternative hypotheses and CαC_{\alpha} be a critical region. The power of the test is the probability of correctly rejecting H0H_0 when H1H_1 is true.

1−β=1−P(Type II error)=P(Reject H0∣H1 is true)1-\beta=1-\mathbb{P}\left(\mathrm{Type}\,\mathrm{II}\,\mathrm{error}\right)=\mathbb{P}\left(\mathrm{Reject}\,H_0\mid H_1\,\mathrm{is}\,\mathrm{true}\right)

Let TT be a test statistic and CαC_{\alpha} be a critical region. The power function of the test is the probability of rejecting H0H_0 as a function of the true parameter value.

π(θ):=Pθ(T∈Cα)  ∀ θ∈Θ\pi\left(\theta\right):=\mathbb{P}_{\theta}\left(T\in C_{\alpha}\right)\,\,\forall\,\theta\in\Theta

The power function has the following properties:

  • the size of the test is sup⁡θ∈Θ0π(θ);\sup_{\theta\in\Theta_0}\pi\left(\theta\right);
  • the power against a particular alternative θ∈Θ1\theta\in\Theta_1 is π(θ);\pi\left(\theta\right);
  • tests of the same size are compared by their power functions on Θ1.\Theta_1.

Let H0:θ=θ0H_0:\theta=\theta_0 and H1:θ=θ1H_1:\theta=\theta_1 be simple hypotheses and x‾\underline{x} be an observed random sample. The likelihood ratio of x‾\underline{x} is the ratio of the likelihood under the alternative to the likelihood under the null.

Λ(x‾):=L(θ1∣x‾)L(θ0∣x‾)\Lambda\left(\underline{x}\right):=\frac{\mathcal{L}\left(\theta_1\mid\underline{x}\right)}{\mathcal{L}\left(\theta_0\mid\underline{x}\right)}

Large values of the likelihood ratio indicate that the data are more probable under H1.H_1.

Let H0H_0 and H1H_1 be hypotheses, θ1∈Θ1\theta_1\in\Theta_1 and α∈(0,1).\alpha\in\left(0,1\right). A hypothesis test is a most powerful test of size α\alpha at θ1\theta_1 if and only if no other test of size at most α\alpha has greater power at θ1.\theta_1.

Let H0:θ=θ0H_0:\theta=\theta_0 and H1:θ=θ1H_1:\theta=\theta_1 be simple hypotheses, α∈(0,1)\alpha\in\left(0,1\right) and kk be chosen so that Pθ0(Λ(X‾)≥k)=α.\mathbb{P}_{\theta_0}\left(\Lambda\left(\underline{X}\right)\geq k\right)=\alpha. The Neyman–Pearson lemma states that the test that rejects H0H_0 if and only if Λ(x‾)≥k\Lambda\left(\underline{x}\right)\geq k is the most powerful test of size α\alpha at θ1.\theta_1.

Let H0H_0 be a null hypothesis, H1:θ∈Θ1H_1:\theta\in\Theta_1 be a composite alternative hypothesis and α∈(0,1).\alpha\in\left(0,1\right). A hypothesis test is a uniformly most powerful (UMP) test of size α\alpha if and only if it is a most powerful test of size α\alpha at every θ∈Θ1.\theta\in\Theta_1.

Let {PX; θ:θ∈Θ}\left\{\mathbb{P}_{X;\,\theta}:\theta\in\Theta\right\} be a parametric family with Θ⊆R\Theta\subseteq\mathbb{R} and TT be a statistic. The family has a monotone likelihood ratio in TT if and only if L(θ1∣x‾)L(θ0∣x‾)\frac{\mathcal{L}\left(\theta_1\mid\underline{x}\right)}{\mathcal{L}\left(\theta_0\mid\underline{x}\right)} is a monotonically increasing function of T(x‾)T\left(\underline{x}\right) whenever θ1>θ0.\theta_1>\theta_0. Exponential families have a monotone likelihood ratio in their natural statistic.

Let {PX; θ}\left\{\mathbb{P}_{X;\,\theta}\right\} be a family with a monotone likelihood ratio in T,T, α∈(0,1)\alpha\in\left(0,1\right) and cc be chosen so that Pθ0(T≥c)=α.\mathbb{P}_{\theta_0}\left(T\geq c\right)=\alpha. The Karlin–Rubin theorem states that the one-sided test that rejects H0:θ≤θ0H_0:\theta\leq\theta_0 when T(x‾)≥cT\left(\underline{x}\right)\geq c is UMP of size α\alpha for H1:θ>θ0.H_1:\theta>\theta_0. UMP tests do not exist for two-sided alternatives in general, since the most powerful test against θ1>θ0\theta_1>\theta_0 differs from that against θ1<θ0.\theta_1<\theta_0.

Let H0:θ∈Θ0H_0:\theta\in\Theta_0 and H1:θ∈Θ∖Θ0H_1:\theta\in\Theta\setminus\Theta_0 be hypotheses, θ^\hat{\theta} be the maximum likelihood estimate and θ^0\hat{\theta}_0 be the maximum likelihood estimate restricted to Θ0.\Theta_0. The likelihood ratio test statistic is the ratio of the largest likelihood attainable under H0H_0 to the largest likelihood attainable overall.

λ(x‾):=sup⁡θ∈Θ0L(θ∣x‾)sup⁡θ∈ΘL(θ∣x‾)=L(θ^0∣x‾)L(θ^∣x‾)∈(0,1]\lambda\left(\underline{x}\right):=\frac{\sup_{\theta\in\Theta_0}\mathcal{L}\left(\theta\mid\underline{x}\right)}{\sup_{\theta\in\Theta}\mathcal{L}\left(\theta\mid\underline{x}\right)}=\frac{\mathcal{L}\left(\hat{\theta}_0\mid\underline{x}\right)}{\mathcal{L}\left(\hat{\theta}\mid\underline{x}\right)}\in\left(0,1\right]

The likelihood ratio test is the hypothesis test that rejects H0H_0 for small values of λ(x‾).\lambda\left(\underline{x}\right).

Let Θ0\Theta_0 be specified by rr independent restrictions on the kk-dimensional parameter, so that Θ0\Theta_0 has dimension k−r,k-r, and the regularity conditions hold. Wilks’ theorem states that under H0H_0 the transformed likelihood ratio test statistic converges in distribution to a chi-squared distribution with rr degrees of freedom.

−2log⁡eλ(X‾)→dχr2-2\log_e\lambda\left(\underline{X}\right)\xrightarrow{d}\chi^2_r

Let χr,1−α2\chi^2_{r,1-\alpha} be the (1−α)\left(1-\alpha\right)-quantile of χr2.\chi^2_r. Wilks’ theorem gives the approximate critical region −2log⁡eλ(x‾)≥χr,1−α2-2\log_e\lambda\left(\underline{x}\right)\geq\chi^2_{r,1-\alpha} without deriving the exact sampling distribution. Many standard tests are exact or approximate likelihood ratio tests.

Let H0:θ=θ0H_0:\theta=\theta_0 for a scalar parameter, θ^\hat{\theta} be the maximum likelihood estimate and II be the Fisher information. The Wald test statistic is the squared distance between the unrestricted estimate and the null value divided by its estimated variance.

W:=(θ^−θ0)2(n I(θ^))−1=n I(θ^)(θ^−θ0)2W:=\frac{\left(\hat{\theta}-\theta_0\right)^2}{\left(n\,I\left(\hat{\theta}\right)\right)^{-1}}=n\,I\left(\hat{\theta}\right)\left(\hat{\theta}-\theta_0\right)^2

The Wald test is the hypothesis test that rejects H0H_0 for large values of W.W. Under H0,H_0, W→dχ12.W\xrightarrow{d}\chi^2_1. The Wald test needs only the unrestricted estimate.

Let H0:θ=θ0H_0:\theta=\theta_0 for a scalar parameter, ss be the score and II be the Fisher information. The score test statistic is the squared score of the sample at the null value divided by the Fisher information of the sample.

S:=(∑i=1ns(θ0; xi))2n I(θ0)S:=\frac{\left(\sum_{i=1}^n s\left(\theta_0;\,x_i\right)\right)^2}{n\,I\left(\theta_0\right)}

The score test or Lagrange multiplier test is the hypothesis test that rejects H0H_0 for large values of S.S. Under H0,H_0, S→dχ12.S\xrightarrow{d}\chi^2_1. The score test measures how far the score at the null value is from zero, which it would be at the unrestricted maximum, and needs no maximisation. The likelihood ratio, Wald and score tests have the following properties:

  • for a vector parameter with rr restrictions the Wald and score statistics are quadratic forms in the Fisher information matrix with limiting distribution χr2;\chi^2_r;
  • the three tests are asymptotically equivalent under H0H_0 and against alternatives close to it, but can differ in finite samples;
  • the Wald test is not invariant to reparametrisation whereas the other two are.

Let X‾\underline{X} be a random sample of size nn from N(μ,σ2).\mathrm{N}\left(\mu,\sigma^2\right). The sample mean and sample variance are independent, and their sampling distributions are as follows.

X‾n∼N(μ,σ2n),(n−1)Sn2σ2∼χn−12,n(X‾n−μ)Sn∼tn−1\overline{X}_n\sim\mathrm{N}\left(\mu,\frac{\sigma^2}{n}\right),\qquad\frac{\left(n-1\right)S_n^2}{\sigma^2}\sim\chi^2_{n-1},\qquad\frac{\sqrt{n}\left(\overline{X}_n-\mu\right)}{S_n}\sim t_{n-1}

The standard tests for normal populations follow from these sampling distributions, each with its test statistic and sampling distribution under H0:H_0:

  • the zz-test for H0:μ=μ0H_0:\mu=\mu_0 with known variance uses Z=n(X‾n−μ0)σ∼N(0,1);Z=\frac{\sqrt{n}\left(\overline{X}_n-\mu_0\right)}{\sigma}\sim\mathrm{N}\left(0,1\right);
  • the one-sample tt-test for H0:μ=μ0H_0:\mu=\mu_0 with unknown variance uses T=n(X‾n−μ0)Sn∼tn−1;T=\frac{\sqrt{n}\left(\overline{X}_n-\mu_0\right)}{S_n}\sim t_{n-1};
  • the two-sample tt-test for H0:μ1=μ2H_0:\mu_1=\mu_2 from independent samples of sizes n1n_1 and n2n_2 with a common variance uses the pooled variance Sp2=(n1−1)S12+(n2−1)S22n1+n2−2S_p^2=\frac{\left(n_1-1\right)S_1^2+\left(n_2-1\right)S_2^2}{n_1+n_2-2} and T=X‾1−X‾2Sp1n1+1n2∼tn1+n2−2;T=\frac{\overline{X}_1-\overline{X}_2}{S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}\sim t_{n_1+n_2-2};
  • Welch’s tt-test is the two-sample tt-test without the common variance assumption, which uses an approximate tt distribution;
  • the paired tt-test applies the one-sample tt-test to the differences of paired observations;
  • the chi-squared test for a variance for H0:σ2=σ02H_0:\sigma^2=\sigma_0^2 uses (n−1)Sn2σ02∼χn−12;\frac{\left(n-1\right)S_n^2}{\sigma_0^2}\sim\chi^2_{n-1};
  • the FF-test for equality of variances for H0:σ12=σ22H_0:\sigma_1^2=\sigma_2^2 uses F=S12S22∼Fn1−1,n2−1.F=\frac{S_1^2}{S_2^2}\sim F_{n_1-1,n_2-1}.

By the central limit theorem the zz- and tt-tests for means remain approximately valid for large samples from non-normal populations, whereas the tests for variances are sensitive to non-normality.

Let nn observations fall into kk categories with observed counts O1,…,Ok,O_1,\ldots,O_k, and Ei=n piE_i=n\,p_i be the counts expected under a hypothesised distribution p‾\underline{p} that may depend on qq parameters estimated from the data. Pearson’s chi-squared test statistic is the sum of the squared differences between observed and expected counts divided by the expected counts.

X2:=∑i=1k(Oi−Ei)2EiX^2:=\sum_{i=1}^k\frac{\left(O_i-E_i\right)^2}{E_i}

Pearson’s chi-squared test is the hypothesis test that rejects H0H_0 for large values of X2.X^2. Under H0,H_0, X2→dχk−1−q2.X^2\xrightarrow{d}\chi^2_{k-1-q}. Pearson’s chi-squared test has the following properties:

  • as a goodness-of-fit test it assesses whether the data follow the hypothesised distribution;
  • applied to an r×cr\times c table of counts with expected counts computed from the row and column totals, it gives the chi-squared test of independence with (r−1)(c−1)\left(r-1\right)\left(c-1\right) degrees of freedom;
  • it is an approximation to the likelihood ratio test for multinomial counts.

A non-parametric test is a hypothesis test that makes no parametric assumption about the population. The Kolmogorov–Smirnov test of H0:F=F0H_0:F=F_0 is the non-parametric test that uses the statistic sup⁡x∣F^n(x)−F0(x)∣,\sup_x\left\lvert\hat{F}_n\left(x\right)-F_0\left(x\right)\right\rvert, whose null distribution does not depend on F0.F_0. The Wilcoxon tests are non-parametric tests that replace observations by their ranks.

Hypothesis tests and confidence intervals are dual: the set of values θ0\theta_0 for which H0:θ=θ0H_0:\theta=\theta_0 is not rejected at size α\alpha is a 100(1−α)%100\left(1-\alpha\right)\% confidence interval for θ,\theta, and conversely H0:θ=θ0H_0:\theta=\theta_0 is rejected at size α\alpha if and only if θ0\theta_0 lies outside a 100(1−α)%100\left(1-\alpha\right)\% confidence interval. For example, the one-sample tt-test does not reject μ0\mu_0 if and only if μ0∈X‾n±tn−1,1−α2Snn.\mu_0\in\overline{X}_n\pm t_{n-1,1-\frac{\alpha}{2}}\frac{S_n}{\sqrt{n}}.

Let H0,1,…,H0,mH_{0,1},\ldots,H_{0,m} be m>1m>1 null hypotheses with pp-values p1,…,pm,p_1,\ldots,p_m, of which an unknown m0m_0 are true. Multiple testing is the simultaneous testing of the mm hypotheses. Multiple testing has the following properties:

  • if each hypothesis is tested at size α\alpha then the expected number of true null hypotheses rejected is m0α;m_0\alpha;
  • for independent tests the probability of at least one false rejection is 1−(1−α)m0,1-\left(1-\alpha\right)^{m_0}, which approaches one as m0m_0 grows.

Let H0,1,…,H0,mH_{0,1},\ldots,H_{0,m} be a family of null hypotheses. The family-wise error rate (FWER) is the probability of making at least one type I error across the family of tests.

FWER:=P(at  least  one  true  H0,i  is  rejected)\mathrm{FWER}:=\mathbb{P}\left(\mathrm{at}\,\,\mathrm{least}\,\,\mathrm{one}\,\,\mathrm{true}\,\,H_{0,i}\,\,\mathrm{is}\,\,\mathrm{rejected}\right)

A multiple testing procedure controls the FWER at level α\alpha if and only if FWER≤α\mathrm{FWER}\leq\alpha for every configuration of true and false null hypotheses.

Let H0,1,…,H0,mH_{0,1},\ldots,H_{0,m} be a family of null hypotheses with pp-values p1,…,pmp_1,\ldots,p_m and α∈(0,1).\alpha\in\left(0,1\right). The Bonferroni correction is the procedure that rejects H0,iH_{0,i} if and only if pi≤αm.p_i\leq\frac{\alpha}{m}. The Bonferroni correction has the following properties:

  • it controls the FWER at level α\alpha under any dependence between the tests, since the probability of a union of events is at most the sum of their probabilities, FWER≤∑i: H0,i trueP(pi≤αm)≤m0αm≤α;\mathrm{FWER}\leq\sum_{i:\,H_{0,i}\,\mathrm{true}}\mathbb{P}\left(p_i\leq\tfrac{\alpha}{m}\right)\leq\frac{m_0\alpha}{m}\leq\alpha;
  • it is conservative and loses power as mm grows.

Let H0,1,…,H0,mH_{0,1},\ldots,H_{0,m} be a family of null hypotheses with ordered pp-values p(1)≤…≤p(m)p_{(1)}\leq\ldots\leq p_{(m)} and α∈(0,1).\alpha\in\left(0,1\right). Holm’s procedure is the procedure that rejects the hypotheses corresponding to p(1),…,p(k−1),p_{(1)},\ldots,p_{(k-1)}, where kk is the smallest index with

p(k)>αm−k+1,p_{(k)}>\frac{\alpha}{m-k+1},

so that each successive pp-value is compared with a less stringent threshold. Holm’s procedure controls the FWER at level α\alpha under any dependence and rejects every hypothesis that the Bonferroni correction rejects, so it is uniformly more powerful.

Let H0,1,…,H0,mH_{0,1},\ldots,H_{0,m} be a family of null hypotheses tested by some procedure, RR be the number of rejected hypotheses and VV be the number of rejected hypotheses that are true null hypotheses. The rejected true null hypotheses are the false discoveries. The false discovery proportion is the fraction of rejections that are false discoveries, Vmax⁡{R,1}.\frac{V}{\max\{R,1\}}. The false discovery rate (FDR) is the expectation of the false discovery proportion.

FDR:=E[Vmax⁡{R,1}]\mathrm{FDR}:=\mathbb{E}\left[\frac{V}{\max\{R,1\}}\right]

A multiple testing procedure controls the FDR at level α\alpha if and only if FDR≤α\mathrm{FDR}\leq\alpha for every configuration of true and false null hypotheses. FDR control has the following properties:

  • it allows false rejections as long as they are on average a small fraction of all rejections, which is less strict than FWER control when mm is large;
  • when all null hypotheses are true the FDR equals the FWER, so FDR control is weaker than FWER control.

Let H0,1,…,H0,mH_{0,1},\ldots,H_{0,m} be a family of null hypotheses with ordered pp-values p(1)≤…≤p(m)p_{(1)}\leq\ldots\leq p_{(m)} and α∈(0,1).\alpha\in\left(0,1\right). The Benjamini–Hochberg procedure is the procedure that finds the largest kk with

p(k)≤kmαp_{(k)}\leq\frac{k}{m}\alpha

and rejects the hypotheses corresponding to p(1),…,p(k),p_{(1)},\ldots,p_{(k)}, rejecting none if no such kk exists. If the pp-values of the true null hypotheses are independent, or positively dependent in a specific sense, then the Benjamini–Hochberg procedure controls the FDR at level m0mα≤α.\frac{m_0}{m}\alpha\leq\alpha.

The Benjamini–Yekutieli procedure is the Benjamini–Hochberg procedure with α\alpha replaced by α∑i=1m1i,\frac{\alpha}{\sum_{i=1}^m\frac{1}{i}}, which controls the FDR under arbitrary dependence.

Multiple testing corrections only account for the tests that are actually performed, so selecting which hypotheses to test or to report after seeing the data invalidates the stated error rates.