# Test statistics

A test statistic , also called a test variable , test variable , test test variable , or test function , is a special real-valued function in test theory , a branch of mathematical statistics . Test statistics are used as an aid in defining statistical tests . For example, in a hypothesis test, the null hypothesis is rejected if the test statistic is above or below a predetermined numerical value.

## definition

Given a function

${\ displaystyle T \ colon {\ mathcal {X}} \ to \ mathbb {R}}$

as well as a statistical test

${\ displaystyle \ varphi \ colon {\ mathcal {X}} \ to [0,1]}$,

which is defined by

${\ displaystyle \ varphi (X) = {\ begin {cases} 1 & {\ text {if}} \ quad T (X)> k \\ 0 & {\ text {if}} \ quad T (X) \ leq k \ end {cases}}}$.

This is a fixed number, which is also called the critical value . Then the function is called a test statistic. ${\ displaystyle k}$${\ displaystyle T}$

The definition also applies to randomized tests and variants of the above definition of the test. This includes swapping or changing the inequality sign and swapping zero and one.

## Examples

Using the abbreviation

${\ displaystyle {\ overline {X}} = {\ frac {1} {n}} \ left (X_ {1} + X_ {2} + \ ldots + X_ {n} \ right)}$

for the sample mean , a typical test statistic is given by ${\ displaystyle {\ mathcal {X}} = \ mathbb {R} ^ {n}}$

${\ displaystyle T (X) = {\ sqrt {n}} \ cdot {\ frac {{\ overline {X}} - \ mu} {\ sigma}}}$

Where is a positive number and any real number. These test statistics are used, for example, in the Gaussian tests . This makes use of the fact that the test statistic is normally normally distributed , i. H. if the sample variables are normally distributed with mean and variance . ${\ displaystyle \ sigma}$${\ displaystyle \ mu}$${\ displaystyle T \ sim {\ mathcal {N}} (0,1)}$ ${\ displaystyle X_ {1}, X_ {2}, \ dots, X_ {n}}$${\ displaystyle \ mu}$${\ displaystyle \ sigma ^ {2}}$

Is called with

${\ displaystyle V ^ {*} (X) = {\ frac {1} {n-1}} \ sum _ {i = 1} ^ {n} (X_ {i} - {\ overline {X}}) ^ {2}}$

the corrected sample variance , so another important test statistic is given by ${\ displaystyle {\ mathcal {X}} = \ mathbb {R} ^ {n}}$

${\ displaystyle T (X) = {\ sqrt {n}} \ cdot {\ frac {{\ overline {X}} - \ mu} {\ sqrt {V ^ {*} (X)}}}}$.

Here again is any real number. These test statistics are used in the one- sample t-test . Similar to the example above, it is used that if the sample variables are normally distributed with variance and mean , the test statistic is t-distributed with degrees of freedom . It then applies . ${\ displaystyle \ mu}$${\ displaystyle \ sigma ^ {2}}$${\ displaystyle \ mu}$${\ displaystyle (n-1)}$ ${\ displaystyle T \ sim \ mathbf {t} _ {n-1}}$

A third important test statistic is

${\ displaystyle T (X): = \ sum _ {i = 1} ^ {n} \ left ({\ frac {X_ {i} - \ mu} {\ sigma}} \ right) ^ {2}}$

There is and . For example, it is used in the chi-square test for variance. It is used here that the chi-square distribution is when the sample variables are normally distributed with expected value and variance . ${\ displaystyle \ mu \ in \ mathbb {R}}$${\ displaystyle \ sigma> 0}$${\ displaystyle T}$ ${\ displaystyle \ mu}$${\ displaystyle \ sigma ^ {2}}$

If you look at a test and denote the formation of the expected value with regard to a probability distribution , then expressions of the form often appear in test theory ${\ displaystyle \ varphi}$${\ displaystyle \ operatorname {E} _ {\ vartheta}}$${\ displaystyle P _ {\ vartheta}}$

${\ displaystyle \ operatorname {E} _ {\ vartheta _ {0}} (\ varphi)}$ or ${\ displaystyle 1- \ operatorname {E} _ {\ vartheta _ {1}} (\ varphi)}$

on. The first expression corresponds to type 1 error and the second to type 2 error if is in the null hypothesis and in the alternative. In general, such expressions are difficult to compute because the test itself has little structure ${\ displaystyle \ vartheta _ {0}}$${\ displaystyle \ vartheta _ {1}}$${\ displaystyle \ varphi}$

Assuming a non- randomized test (the randomized case follows with slight adjustments), the test can be written as ${\ displaystyle \ varphi}$

${\ displaystyle \ varphi (X) = \ mathbf {1} _ {A} (X)}$.

Here the rejection area of the test and the indicator function is on the crowd . With this notation then follows in particular ${\ displaystyle A}$${\ displaystyle \ mathbf {1} _ {A} (X)}$${\ displaystyle A}$

${\ displaystyle \ operatorname {E} _ {\ vartheta} (\ varphi) = P _ {\ vartheta} (A)}$

If the test is now defined by a test statistic , for example by ${\ displaystyle T}$

${\ displaystyle \ varphi (X) = {\ begin {cases} 1 & {\ text {if}} \ quad T (X)> k \\ 0 & {\ text {if}} \ quad T (X) \ leq k \ end {cases}}}$,

so the rejection area is of the form

${\ displaystyle A = \ {X \ in {\ mathcal {X}} \ mid T (X)> k \}}$.

However, this reduces the determination of the expected value of the test

${\ displaystyle \ operatorname {E} _ {\ vartheta} (\ varphi) = P _ {\ vartheta} (A) = P _ {\ vartheta} (\ {X \ in {\ mathcal {X}} \ mid T (X )> k \})}$.

This allows the expected value of the test to be determined directly if the distribution of the test statistic is known. As the three examples above show, this is the case with many important tests.

The simpler calculation of the expected value over the distribution of the test statistic is used in different ways. On the one hand with hypothesis tests before the data evaluation, in order to adapt the critical value so that the test adheres to the desired error of the first type. On the other hand, in the case of significance tests after the data evaluation to determine the p-value . Test statistics thus facilitate the handling and construction of tests. ${\ displaystyle k}$

## Individual evidence

1. Wolfgang Tschirk: Statistics: Classical or Bayes . Two ways in comparison. 1st edition. Springer Spectrum, Berlin / Heidelberg 2014, ISBN 978-3-642-54384-5 , p. 67 , doi : 10.1007 / 978-3-642-54385-2 .
2. ^ Karl Bosch: Elementary introduction to applied statistics . 8th edition. Vieweg, Wiesbaden 2005, p. 178 .
3. ^ A b Ludger Rüschendorf: Mathematical Statistics . Springer Verlag, Berlin Heidelberg 2014, ISBN 978-3-642-41996-6 , p. 195 , doi : 10.1007 / 978-3-642-41997-3 .
4. ^ Hans-Otto Georgii: Stochastics . Introduction to probability theory and statistics. 4th edition. Walter de Gruyter, Berlin 2009, ISBN 978-3-11-021526-7 , p. 282 , doi : 10.1515 / 9783110215274 .