Topic 6 One-sample t-test
6.1 Intuition (extra)
Recall that the one-sample t-test is simply a way to test a null hypothesis for a variable in a single sample. To do a t-test, we do the following:
We standardize the difference between the sample mean and the guess of population mean. This is the same type of standardization that we did with z-scores. The standardization gives a value of (we called it a statistic). It follows a t-distribution (when our original distribution is normal). The mean of the distribution is 0.
We check where our calculated follows in the t-distribution.
If , the guessed population mean equals the sample mean, so our guess is correct and we do not reject the null.
What if ? This means that the mean of this sample is not equal to our guess. But does that mean that our guess is wrong for other samples of the same population? We need to be carefull with our conclusions since we do not want to reject a true null (type I error).
What do we do? We ask ourselves: how far from 0 does have to be so we can say our guess is wrong for the population? If , we say it has to be far enough that it represents only 5% of the distribution (it is in the 95th percentile for a one-sided test or 97.5th percentile for a two-sided test).
Therefore, we reject the null hypothesis when we have a value of that is high enough, that it would only happen 5% (or less) of the times if the distribution actually has mean 0.
6.3 Interpretation
6.3.1 Option 1: t values
Once we have we compare it to a value which represents a value of that has only chance of happening. For , we compare it to a value . We call the critical value.
- We do not need to calculate these values. They are in a t-table.
- Note that degrees of freedom = .
To use those tables, look for for a one sided test or for a two-sided test.
In short:
- if the calculated is higher than the critical value (), we reject the null hypothesis.
- if the calculated is lower than the critical value (), we do not reject the null hypothesis.
6.3.2 Option 2: p-values
Another to interpret is to look at what is called a p-value or significance level.
A p-value gives the chance (or probability) of your calculated statistic being selected in a t-distribution. It gives us the minimum for which we could reject the null, that is why we call it the significance level.
General rule:
- For (95% confidence level), we reject the null hypothesis only when
- For (99% confidence level), we reject the null hypothesis only when
6.4 Exercises
We will examine different datasets in class. Here are some questions to consider each time:
- Which value of should you choose if you want to test if the sample mean = population mean?
- How do you interpret your p-value?
- How do you interpret your confidence interval?
- What is your conclusion about the population mean?