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.

Binomial example

In a situation where we are interested in the probability of success, \(\pi\), our data might be the successes and failures in \(n = 90\) independent trials. To test the hypotheses,

The number of successes, \(X\), might be used as a test statistics since