Test statistic
A hypothesis test is based on a quantity called a test statistic that is a function of the data. Because it is found from random data, it can also be treated as a random variable with a distribution. The test statistic should have the following properties.
Example: Telepathy experiment
In the telepathy experiment that was described on the previous page, one subject selects 90 cards with random shapes (circle, square or cross) and attempts to 'send' these shapes to another subject who is seated behind a screen. This second subject reports the shape imagined for each card.
To test whether there was telepathy, the two hypotheses are
The number of correctly guessed cards, \(X\), is the number of "successes" in 90 independent "trials", so
\[ X \;\;\sim\;\; \BinomDistn(n=90, \pi) \]This random variable could be used as a test statistic.
Example: Aircraft air-conditioner failures
In the aircraft air-conditioner failure data, our model was that the 199 times between failures were a random sample of values with exponential distributions,
\[ X_i \;\;\sim\;\; \ExponDistn(\lambda) \qquad \text{for } i=1,\dots, 199 \]We will compare the following two hypotheses.
The sum of \(n=199\) exponential random variables has an Erlang distribution,
\[ \sum{X_i} \;\sim\; \ErlangDistn(199, \lambda) \]This can be used as a test statistic.
In the next page, we will show how such a test statistic helps to compare the two hypotheses.