# 9.2: Hypothesis Testing with t


Hypothesis testing with the $$t$$-statistic works exactly the same way as $$z$$-tests did, following the four-step process of

1. Stating the Hypothesis
2. Finding the Critical Values
3. Computing the Test Statistic
4. Making the Decision.

We will work though an example: let’s say that you move to a new city and find an auto shop to change your oil. Your old mechanic did the job in about 30 minutes (though you never paid close enough attention to know how much that varied), and you suspect that your new shop takes much longer. After 4 oil changes, you think you have enough evidence to demonstrate this.

Step 1 State the Hypotheses:

Our hypotheses for 1-sample t-tests are identical to those we used for $$z$$-tests. We still state the null and alternative hypotheses mathematically in terms of the population parameter and written out in readable English. For our example:

$$H_0$$: This shop does not take longer to change oil than your old mechanic

$$H_0: μ \leq 30$$

$$H_A$$: This shop takes longer to change oil than your old mechanic

$$H_A: μ > 30$$

Step 2 Find the Critical Values:

As noted above, our critical values still delineate the area in the tails under the curve corresponding to our chosen level of significance. Because we have no reason to change significance levels, we will use $$α$$ = 0.05, and because we suspect a direction of effect, we have a one-tailed test. To find our critical values for $$t$$, we need to add one more piece of information: the degrees of freedom. For this example:

$df = N – 1 = 4 – 1 = 3 \nonumber$

Going to our $$t$$-table, we find the column corresponding to our one-tailed significance level and find where it intersects with the row for 3 degrees of freedom. As shown in Figure $$\PageIndex{1}$$: our critical value is $$t*$$ = 2.353

We can then shade this region on our $$t$$-distribution to visualize our rejection region

Step 3 Compute the Test Statistic:

The four wait times you experienced for your oil changes at the new shop were 46 minutes, 58 minutes, 40 minutes, and 71 minutes. We will use these to calculate $$M$$ and s by first filling in the sum of squares table in Table $$\PageIndex{1}$$:

Table $$\PageIndex{1}$$: Sum of Squares Table
$$X$$ $$\mathrm{X}-M$$ $$(\mathrm{X}-M)^{2}$$
46 -7.75 60.06
58 4.25 18.06
40 -13.75 189.06
71 17.25 297.56
$$\Sigma$$=215 $$\Sigma$$=0 $$\Sigma$$=564.74

After filling in the first row to get $$\Sigma$$=215, we find that the mean is $$M$$ = 53.75 (215 divided by sample size 4), which allows us to fill in the rest of the table to get our sum of squares $$SS$$ = 564.74, which we then plug in to the formula for standard deviation from chapter 3:

$s=\sqrt{\dfrac{\sum(X-M)^{2}}{N-1}}=\sqrt{\dfrac{S S}{d f}}=\sqrt{\dfrac{564.74}{3}}=13.72 \nonumber$

Next, we take this value and plug it in to the formula for standard error:

$s_{M}=\dfrac{s}{\sqrt{n}}=\dfrac{13.72}{2}=6.86 \nonumber$

And, finally, we put the standard error, sample mean, and null hypothesis value into the formula for our test statistic $$t$$:

$t=\dfrac{M-\mu}{s_{M}}=\dfrac{53.75-30}{6.86}=\dfrac{23.75}{6.68}=3.46 \nonumber$

This may seem like a lot of steps, but it is really just taking our raw data to calculate one value at a time and carrying that value forward into the next equation: data, sample size/degrees of freedom, mean, sum of squares, standard deviation, standard error, and finally the test statistic. At each step, we simply match the symbols of what we just calculated to where they appear in the next formula to make sure we are plugging everything in correctly.

Step 4 Make the Decision:

Now that we have our critical value and test statistic, we can make our decision using the same criteria we used for a $$z$$-test. Our obtained $$t$$-statistic was $$t$$ = 3.46 and our critical value was $$t* = 2.353: t > t*$$, so we reject the null hypothesis and conclude:

Based on our four oil changes, the new mechanic takes longer on average ($$M$$ = 53.75) to change oil than our old mechanic, $$t(3)$$ = 3.46, $$p$$ < .05.

Notice that we also include the degrees of freedom in parentheses next to $$t$$. And because we found a significant result, we need to calculate an effect size, which is still Cohen’s $$d$$, but now we use $$s$$ in place of $$σ$$:

$d=\dfrac{M-\mu}{s}=\dfrac{53.75-30.00}{13.72}=1.73 \nonumber$

This is a large effect. It should also be noted that for some things, like the minutes in our current example, we can also interpret the magnitude of the difference we observed (23 minutes and 45 seconds) as an indicator of importance since time is a familiar metric.