AP Statistics Lectures
Table of Contents
by Arnold Kling

Chapter 11: the t test

In chapter 10, we assumed that we know the population standard deviation, even in situations where we do not know the population mean. This unrealistic assumption made it easier to introduce a lot of new terminology while sticking to the familiar realm of the normal distribution.

In chapter 11, the good news is that we finally make the realistic assumption that we know neither the population mean nor the population standard deviation. The bad news is that the distribution that we work with to compute confidence intervals and significance levels is an unfamiliar distribution called the t distribution. Worse news is that there are many t distributions, not just one.

When we do not know the population standard deviation, we can use our sample data to calculate the square root of the sum of squared deviations from x. This statistic, called s, is the standard error. The standard error is a sample statistic, to distinguish it from the standard deviation, which is a population parameter. Sample statistics are observable, while population parameters are unknown.

As an estimator of the population standard deviation, the sample standard error is biased downward. This is because when we calculate the standard error, we treat the sample average x as if it were the true population mean m. For any sample, the sum of squared deviations from the sample average will be smaller than the sum of squared deviations from any other constant. In particular, it will be smaller than the sum of squared deviations from the unknown true population mean.

Another way of putting this is that the calculation of the sample standard error is artificially restricted to be centered around the sample average x. We say that this reduces the degrees of freedom of the sample standard error. The importance of this depends on the size of the sample. That is why there is a family of t distributions--a different distribution depending on the number of degrees of freedom.

The basic formula

To compute a t-statistic, you calculate a ratio that looks a lot like a z-score, except that you substitute the sample standard error s for the unknown population standard deviation s.

For example, to compute a test statistic for the null hypothesis that the population mean is equal to some value m, you take

t = (x - m)/(s/[square root of n])

where n is the sample size, s is the sample standard error, and m is the null hypothesis of the sample mean. (If instead of doing a hypothesis test we were calculating a confidence interval, we would use the margin of error m rather than m.)

The t-distribution that you use to calculate this test is the one with n-1 degrees of freedom. When we were using the normal distribution, we did not have to pick a different distribution depending on sample size--we just used n to adjust the standard deviation. .

Now, the sample size affects which t distribution we use. We actually have to pick a different distribution based on degrees of freedom. That is, our critical values for a confidence interval or for rejecting the null hypothesis are no longer constants--they depend on the degrees of freedom, which in turn depend on sample size.

For example, suppose that we gave 25 people a diet pill, and the average weight loss in the sample was 4 pounds with a sample standard error of 10 pounds. We want to test the null hypothesis that the diet pill has no effect.

We compute the t-ratio as (4-0)/(10/5) = 2.0.

Instead of taking [1 - normcdf(-100,2.0)] or normcdf(-2.0) to calculate the P-value, we take tcdf(-2.0,24) or [1 - tcdf(-100,2.0,24)] to calculate the P-value. That is, we use 24 (n -1) degrees of freedom to select the t-distribution.

If you do not have a TI-83 calculator, you can use the table in the back of the book to try to interpolate the P-value. Looking at the table row with 24 degrees of freedom, a value of 2.0 gives an upper-tail probability between .05 and .025. Therefore, the P-value appears to be approximately .027(?).

Large Samples

As the sample size, n, gets large, the t distribution approaches the normal distribution. Before computers and calculators became widespread, it was common to use the normal distribution to set confidence intervals and calculate P-values when the sample size got above 30.

With electronic computation available, the tendency is to use the more exact t calculations all the time. However, it is worth bearing in mind that for all practical purposes when n is 30 or more you can use the normal distribution to calculate reasonably accurate P-values and confidence intervals.