Test statistic

Intermediate

What you need first. Nothing else on this path comes first. This page is part of Statistical inference.

In statistical inference, a test statistic is a function of the sample used to decide whether a stated hypothesis is rejected. A hypothesis test ends in a comparison. Some function of the sample is set beside a reference distribution that was fixed with the hypothesis. That function is the test statistic. The reference distribution says which of its values are surprising if the hypothesis is true. The statistic itself is only the number the sample produced. [1] [2]

Test statistic

Test statistic
Fact Value
Topic Statistical inference
Listed on Statistical inference
Worked example 1

Motivating example

A simple random sample of 1,028 US adults in March 2013 found that 56 percent supported nuclear arms reduction. The question is whether that is convincing evidence, at the 5 percent level, that a majority of Americans supported the policy. The null hypothesis takes the population proportion to be p0=0.5p_0=0.5. The sample proportion is 0.560.56. The gap 0.060.06 is not yet a test. It becomes one when it is divided by the standard error computed from the null value, the sample size, and the normal approximation. The resulting ZZ is the test statistic. [2]

Intuition

Dodge’s account of a test has a fixed order. State the null and the alternative. Choose a significance level. Name the distribution of the statistic under the null. Compute the critical value and the rejection region. Then see whether the statistic computed from the sample lands in that region. The statistic is the piece that the sample is allowed to change. The rejection region is chosen before the data, from the null distribution. A large value is evidence against the null only because the region was drawn in the tail of that distribution. A small value, for a statistic that rejects only when it is large, is what the null tends to produce. [1]

The same idea appears in a rank test and in a proportion test. The Kruskal–Wallis statistic HH is large when the rank sums are uneven, and the test rejects for large HH only. The normal ZZ for a proportion is large when the sample proportion is far from the null value on the standard-error scale. In both cases the statistic is a reduction of the sample to one number, and the test is a rule for that number. [3] [2]

Definition

A test statistic is a function of the sample used to decide a hypothesis. For a single proportion, with null value p0p_0, sample proportion p^\hat p, and sample size nn, the normal approximation uses

Z=p^−p0SE,SE=p0(1−p0)n.Z=\frac{\hat p-p_0}{\mathrm{SE}},\qquad \mathrm{SE}=\sqrt{\frac{p_0(1-p_0)}{n}}.

The standard error is computed from p0p_0, not from p^\hat p, because the reference distribution is the distribution of ZZ when the null is true. Under that null, and when np0np_0 and n(1−p0)n(1-p_0) are both at least 10, ZZ is referred to a standard normal curve. The pp-value is a tail area of that curve beyond the observed ZZ. The test statistic and the pp-value are different objects. One is the observed number. The other is a probability computed from it under the null. [2]

Neyman and Pearson’s formulation makes the statistic the quantity whose null distribution determines the critical value. The decision rule rejects the null when the observed statistic falls in the rejection region, and does not reject it when the statistic falls in the acceptance region. The level α\alpha is the null probability of the rejection region. It is set with the region, not read off after the sample has chosen a convenient threshold. [1]

Statistical use

OpenIntro’s four steps for a one-proportion test put the statistic in the calculation step, after the hypotheses and the conditions. Prepare: name the parameter, the hypotheses, the level, p^\hat p, and nn. Check: the observations are independent, and the success-failure counts np0np_0 and n(1−p0)n(1-p_0) are large enough for the normal approximation. Calculate: the standard error from p0p_0, then ZZ, then the tail probability. Conclude by comparing that probability with α\alpha. If the pp-value is below α\alpha, reject the null. If it is not, the sample has not met the pre-set standard. In either case the conclusion is about the population claim, in the language of the study, and it reports the statistic that was compared. [2]

A different testing problem uses a different statistic and the same logic. A chi-squared comparison of several groups, or a rank comparison, reduces the sample to one number and refers that number to a distribution fixed by the null. Reporting “significant” without the statistic, the degrees of freedom or the table, and the level, leaves out the comparison the test consisted of. [1] [3]

Worked example

For the arms-reduction poll, n=1028n=1028, p^=0.56\hat p=0.56, and p0=0.5p_0=0.5. The null success-failure counts are 1028×0.5=5141028\times 0.5=514, well above 10. The standard error is

SE=0.5×0.51028=0.251028≈0.0156.\mathrm{SE}=\sqrt{\frac{0.5\times 0.5}{1028}}=\sqrt{\frac{0.25}{1028}}\approx 0.0156.

The test statistic is

Z=0.56−0.500.0156≈3.85.Z=\frac{0.56-0.50}{0.0156}\approx 3.85.

The upper tail beyond 3.853.85 on a standard normal curve is about 0.00010.0001. Doubling it for a two-sided test gives a pp-value of about 0.00020.0002, which is below 0.050.05, so the test rejects p=0.5p=0.5. The poll is evidence that a majority supported arms reduction in that sample’s population. The number 3.853.85 is the test statistic. The number 0.00020.0002 is the tail probability. [2]

Your turn. A sample of size 100100 has p^=0.60\hat p=0.60, and the null value is again 0.50.5. Compute the standard error from the null and the test statistic ZZ.

The standard error is 0.25/100=0.05\sqrt{0.25/100}=0.05. Then Z=(0.60−0.50)/0.05=2Z=(0.60-0.50)/0.05=2.

Common misconceptions

The test statistic is not the pp-value, and it is not the estimate. In the poll, 0.560.56 is the estimate, 3.853.85 is the statistic, and 0.00020.0002 is the pp-value. Quoting only the estimate leaves out the standardisation. Quoting only the pp-value leaves out the direction and the size of the departure. [2]

The standard error in the denominator is not the standard error of a confidence interval for pp. A confidence interval usually plugs in p^\hat p. The test plugs in p0p_0, because the curve being used is the null curve. Using p^\hat p in the test’s standard error refers ZZ to a different distribution from the one the critical value was taken from. [2]

A statistic that was chosen after looking at several candidates is not the statistic whose null distribution was tabulated for one pre-specified comparison. The rejection region belongs to the procedure that was declared. Searching and then treating the winner as if it had been declared moves the test into a different procedure, with a different null probability of rejection. [1]

Connections

A p-value is the null tail probability of the test statistic, or of values at least as extreme. A significance level is the null probability of the rejection region, fixed before the statistic is compared with it. A confidence interval standardises the same estimate with a standard error that does not lock the parameter at the null value. The Kruskal–Wallis test is the rank version of the same pattern: one statistic, a one-sided rejection region, a reference distribution determined by the null. Neyman and Pearson’s separation of the null from the alternative is what gives the rejection region a type I error to control. The test statistic is the sample’s input to that region. [1] [2] [3]

Check yourself

Try these questions before opening an answer.

Null standard error

In a test of a single proportion, why is the standard error computed from the null value rather than from the sample proportion?

The reference distribution is the distribution of the statistic when the null is true, so the standardisation uses that null value.

Three different numbers

A proportion test reports a sample proportion, a Z statistic, and a p-value. What does each one measure?

The sample proportion is the estimate. The Z statistic is the estimate minus the null value, divided by the null standard error. The p-value is a tail probability of that statistic under the null.

After the fact

Several comparisons are examined and the most extreme statistic is then treated as the pre-specified test. What has changed about the null probability of rejection?

The rejection probability is now the probability for the search, not the probability tabulated for one pre-specified statistic.

See also

Line chart · Apriori algorithm · Asymptotic analysis · Average treatment effect · Base rate · Bayesian inference · Bayesian model · Bayesian probability

Glossary and index

References

  1. ^ a b c d e f a. (pp. 250–251) b. (pp. 250–251) c. (pp. 250–251) d. (p. 251) e. (pp. 250–251) f. (pp. 250–251) Dodge, Yadolah (2008). The Concise Encyclopedia of Statistics. Springer. https://doi.org/10.1007/978-0-387-32833-1
  2. ^ a b c d e f g h i a. (Ch. 5, §5.3) b. (Ch. 5, §5.3) c. (Ch. 5, §5.3) d. (Ch. 5, §5.3) e. (Ch. 5, §5.3) f. (Ch. 5, §5.3) g. (Ch. 5, §5.3) h. (Ch. 5, §5.3) i. (Ch. 5, §5.3) Diez, D. M., Çetinkaya-Rundel, M. & Barr, C. D. (2019). OpenIntro Statistics (4th ed.). OpenIntro. https://www.openintro.org/book/os/
  3. ^ a b c a. (§7.4.1) b. (§7.4.1) c. (§7.4.1) Heckert, N. A., Filliben, J. J., Croarkin, C. M., Hembree, B., Guthrie, W. F., Tobias, P. & Prinz, J. (2002). NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.1: The Kruskal-Wallis test. National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/prc/section4/prc41.htm
Cite this page
Plain text
StatWiki (2026). "Test statistic." StatWiki. Last updated 2 December 2026. https://www.statwiki.io/articles/test-statistic.html
BibTeX
@misc{statwiki_test_statistic,
  author = {{StatWiki}},
  title = {{Test statistic}},
  year = {2026},
  url = {https://www.statwiki.io/articles/test-statistic.html},
  urldate = {2026-12-02},
  note = {StatWiki, last updated 2 December 2026}
}