How to calculate a test statistic for a mean or proportion
A sample mean or proportion usually differs a little from the value in the null hypothesis. The test statistic tells us how far away it is in standard errors. We’ll choose the tail from the alternative hypothesis, then work out which formula to use.
Use the alternative hypothesis to choose the tails
Let stand for the population mean or proportion and be the value we’re testing. Choose the alternative before looking at the sample results. The direction in the alternative tells us which values of the test statistic count as evidence against the null.
| Alternative | Test |
|---|---|
| Two-tailed | |
| Upper-tailed | |
| Lower-tailed |
The one-sided null includes equality and the opposite direction. For example, goes with . We use the boundary value when we calculate the statistic.
Find the critical values from the significance level
The significance level is the total rejection area under the null. For a two-tailed test at , divide that area between the two tails. On a standard normal table that gives cumulative area to the left, look up and . Those areas give critical values of about and .
For an upper-tailed test at the same level, all goes in the right tail, so use left area and critical value . For a lower-tailed test, use left area and critical value . For a test, use the distribution with the appropriate degrees of freedom.
Choose the formula for a mean or a proportion
For a single population mean, is the sample mean, is the hypothesized mean, and is the sample size. If we know the population standard deviation , use the mean statistic. If is unknown, use the sample standard deviation and the one-sample statistic with degrees of freedom.
These formulas assume independent observations from a random sample. A normal population supports the mean tests even for small samples. With a larger sample, the sampling distribution of the mean can be close to normal. How large a sample we need depends on the population’s shape and the presence of outliers.
For a single population proportion, let be the sample proportion and the hypothesized proportion. The standard error for this test uses . For the normal approximation, a common rule is that both expected counts, and , should be at least .
For example, if out of independent observations have the trait we’re testing for, then . To test , the null predicts observations in each group. Plugging in gives
Calculate a t statistic for monthly sales
A dealership claims it averages in sales each month. A random sample of months has a mean of and a sample standard deviation of . For a test of whether the true mean differs from the claim in either direction, use and , with sales measured in dollars.
Assume the sampled monthly totals are independent and the sample is large enough for the usual approximation. We have the sample standard deviation, so we use with degrees of freedom.
The sample mean is about standard errors below the hypothesized mean. We’d compare that statistic with the two critical values for the chosen significance level.