In this tutorial, you're going to learn about t-tests. Specifically you will focus on:
In a z-test for means, the test statistic is z is equal to the sample mean minus the hypothesized population mean over the standard deviation of the population divided by the square root of sample size.
However, the z-statistic was based on the fact that the population standard deviation was known. If it's not known, you need a new statistic. You're going to use your sample standard deviation, s.
This s over the square root of n value, replacing the sigma over square root of n value, is called the standard error. The only problem with using the sample standard deviation as opposed to the population standard deviation is the value of s can vary largely from sample to sample. Sigma is fixed. You can base your normal distribution off of it.
The sample standard deviation is more variable than the population standard deviation and much more variable for small samples than for large samples. For large samples, a and sigma are very close. But with small samples particularly, the value of s can vary wildly.
So you need a new distribution in order to account for this increased variability of the standard deviation.
Because s is so variable, it creates a distribution of test statistics much like the normal distribution.
The only difference is this is a more heavy-tailed distribution. If you used the normal distribution, it wouldn't underestimate the proportion of extreme values in the sampling distribution. This distribution is called the student's t-distribution, or sometimes just called the t-distribution.
The t-distribution is actually a family of distributions. They all are a little bit shorter than the standard normal distribution and a little heavier on the tails. As the sample size gets larger, the t-distribution does get close to the normal distribution. It doesn't diminish as quickly in the tails when the sample size is small, but gets very close to the normal distribution when n is large. You're going to calculate t-statistics much like we calculated z-statistics.
When running a hypothesis test, there are four parts:
(Step 4 is actually three separate things that you need to do in one step.)
The only difference between a z-test for means and a t-test for means is the test statistic is going to be a t-statistic instead of a z-statistic. And because you’re using the t-distribution instead of the z- distribution, you're going to obtain a different p-value.
You need a new table, not the standard normal table for that. Below is the t-distribution table. You can see in blue the possible "p" values and the area blocked in orange are the "t" values.
Potential p-values are based on the values within the "t" section.
Notice it's actually one-sided and it's the upper side that gives us these tail probabilities here.
The one new wrinkle that you're adding for a t-distribution is this value df (on the left in red). It's called the degrees of freedom.
For your purposes, it's just going to be the sample size minus 1. You find your t- statistic in whatever row your degrees of freedom is. If it's between two values, that means your p- value is between these two p-values.
Here is an example. So the M&Ms in a bag are supposed to weigh collectively 47.9 grams. Suppose you inspected 14 grams and got this distribution.
Assuming the distribution of bag weights is approximately normal, is this evidence that the bags don't contain the amount of candy that they say that they do? First, state the null and alternative hypotheses.
The null is that the mean is 47.9 grams. The alternative is the mean is not 47.9 grams. Our alpha level is going to be 0.05, which means that if the p-value is less than 0.05, this number, reject the null hypothesis.
Moving on, we're going to check the necessary conditions.
Make sure that the sample was collected in a random way. How were the data collected? We're going to verify the observations are dependent by showing that the population is at least 10 times the sample size. And normality. Is the sampling distribution approximately normal? You can verify it with the central limit theorem that says that it will be approximately normal for most distributions if the sample size is 30 or larger, or if the parent distribution is approximately normal.
Verifying each of those, it says in the problem that the bags were randomly selected. You're going to go ahead and assume that there are at least 140 bags of M&Ms. That's 10 times as large as the 14 bags in our sample. Finally, it does say in the problem that the distribution of bag weights is approximately normal, and so normality will be verified for our sampling distribution.
You're going to calculate the test statistic and the p-value. By plugging in all the numbers that you have, you obtain a value of 1.06. That's a t-statistic of positive 1.06.
Where exactly is that?
You need to calculate the probability that you get a t-statistic of 1.06 or larger. The row is highlighted, 13df, because your sample size was 14 and our degrees of freedom is 14 minus 1, 13. Look in row 13 and you're looking for 1.06.
In all likelihood, it's not one of the values listed in the row here, but between two values.
You’ll see it's between the 0.870 and the 1.079, which means that the p-value is going to be between those two numbers. What you see is that looking in the orange row and between the two blue columns, you can find that the p-value is somewhere between those two numbers.
* Critical values table is attached as PDF for your convenience. You can view full screen, or zoom in for clarity.
However, one additional wrinkle is that your particular problem was a two-sided problem. You have to double your p-value. So your p-value will be some number between 0.30 and 0.40. Now the thing about this between 0.30 and 0.40 business is that you can, in fact, use technology to nail down the p-value more exactly. You don't have to use this table. Although you can use the table, to still answer the question about the null hypothesis.
Part four, compare your p-value to your significance level. You don't know exactly what your p-value is, but you know that it's within the range of 0.3 to 0.4. You're going to do three parts. Since your p-value is between 0.3 and 0.4. And both of those-- any number in this range is greater than 0.05. You're going to fail to reject the null hypothesis. There's your decision based on how they compare. And finally, the conclusion is that there's not sufficient evidence to conclude that M&M bags are being filled to a mean other than 47.9 grams.
In cases where the population standard deviation is not known-- which is almost always the case-- you should use the t-distribution to account for the additional variability introduced by using the sample standard deviation in the test statistic. A t-test means that the value will be a "t" statistic instead of a "z" statistic.
The steps in the hypothesis test are the same as they were with a z-test, first stating the non alternative hypotheses, stating and verifying the conclusions of the test, calculating the test statistic and the p-value, and then finally, comparing the p- value to alpha and making a decision about the null hypothesis.
Source: This work adapted from Sophia Author Jonathan Osters.
Source: Table created by Sophia author Parmanand Jagnanden.
A family of distributions that are centered at zero and symmetric like the standard normal distribution, but heavier in the tails. If the sample size is large, the t-distribution approximates the normal distribution.
A hypothesis test for a mean where the population standard deviation is unknown. Due to the increased variability in using the sample standard deviation instead of the population standard deviation, the t-distribution is used in place of the z-distribution.