Hi. This tutorial covers t-tests. So let's start by defining it. A t-test is a type of hypothesis test used to test an assumed population mean when the population's standard deviation, known as sigma, is unknown. OK? In this case, we need to use the sample standard deviation, which is just lowercase s, to estimate sigma.
If our sample size is small, then using the normal distribution underestimates the proportion of the extreme values in the sample. So the tails need to be heavier. So we can't use a normal distribution when we're using s to approximate sigma. So what we need to use instead is a type of distribution known as Student's t-distribution.
A little history behind this. Student was actually a pseudonym for the statistician who came up with this distribution, and he was actually a brewer at the Guinness Brewery in Ireland. But anyway, a t-distribution is a distribution similar to the normal distribution, but depending on the sample size, does not diminish towards the tails as fast.
So the t-distribution is different for each sample size, which is unlike the normal distribution. And for larger sample sizes, the t-distribution approaches the normal distribution. So again, we have four steps for the t-test. I'm going to go through these steps quickly, and then we'll actually do them in an example. So step 1, formulate the null and alternative hypotheses and choose a significance level.
2, check that the conditions of the hypothesis test are met for the random sample you use. Step 3, calculate a test statistic-- so in this case, it's going to be a t value-- and compare to a critical value or find a p-value. And step 4 is to decide whether to reject or not the null hypothesis and then draw conclusion.
All right. So let's go ahead and apply those four steps to this example. So suppose you're interested in the mean daily caffeine consumption in milligrams for the population of US women. Based on the random sample of n equals 60 women, it was found that the sample mean caffeine consumption is 215 with a sample standard deviation of 52. These are both in milligrams.
So in this case, since we don't know sigma, we're going to need to approximate sigma using s. So does this sample provide significant evidence that the mean caffeine consumption for US adult women is greater than 200 milligrams?
So let's go through each of the four steps for this example. So formulate the null and alternative hypotheses and choose a significance level. So we need a pair of hypotheses, a null and an alternative. So the null hypothesis is that mu, your sample mean, or excuse me, your population mean, is equal to 200. And we're trying to see if there's significant evidence to show that the mean daily caffeine consumption is greater than 200 milligrams.
And now we also need to choose a significance level. Remember, your significance level is abbreviated with alpha. The most commonly used significance level is 0.05. So in this case, there would be a 5% chance that I would make a type I error, which is probably a good significance level in this case.
Step 2, check that the conditions for the hypothesis test are met in the random sample you use. So what we're going to do is just assume that the conditions are met here. So again, we'll just assume our conditions in step 2. Generally, at this step, you do actually check them, but we're going to leave that for another tutorial.
Step 3. Calculate a test statistic, t, and compare it to a critical value or find the p-value. So the test statistic we know is z. So we know that z is equal to x bar, your sample mean, minus your hypothesized population mean divided by sigma over the square root of n. Remember, sigma is your population standard deviation and is your sample size. Sometimes, this term down here is your standard error, which we call sigma or we abbreviate as sigma sub x bar.
Now remember, in this case, sigma is unknown in this problem. And a lot of times, it will be unknown. Rarely, will you know a population standard deviation if you don't know a population mean. And remember that the whole purpose of doing a hypothesis test is to test a value of the population mean. So if your population mean is unknown, generally, your population standard deviation will also be unknown.
But remember, we do know a sample standard deviation. So what we're going to be doing is we're going to be approximating your standard error with s over the square root of n. So instead of sigma over the square root of n, we're going to use s over the square root of n. If we're using this approximation, we can't really use z anymore, so in this case, we do use t.
So t is going to equal x bar minus mu over s over the square root of n. So now let's actually calculate t for our specific example here. So we know that t is going to equal 215, our sample mean, minus our hypothesized population mean, which is 200. And then we're going to divide by s over the square root of n, so 52 over the square root of 60.
And I'm going to do this in my calculator. So I'm going to take 215 minus 200 divided by 52 divided by the square root of 60. So what I end up with is a t value of about 2.234. So I'm going to write that down. That is my test statistic, 2.234.
And now what I need to do is calculate a p-value. So for my p-value, I'm going to also use my calculator. So remember, my p-value is the area under the specified test statistic distribution-- so in this case, it's going to be the area under the t-distribution-- from my actual test statistic. And now I'm doing an upper tail test, so it's going to be the probability of getting a t value of 2.234 or more.
So in the calculator, I'm going to go and select the tcdf function. Now, the tcdf function has three arguments. The first argument, I'm going to put in my last answer, which was my t value. And then I'm going to do comma, and since it's an upper tail test, I'm going to use a really large number to represent positive infinity. And then my third argument is my degrees of freedom. And all that is just your sample size minus 1. So our sample size was 60, so our degrees of freedom is going to be 59.
And I'm going to hit Enter here, and I get a p-value of 0.0146. So 0.0146. Now remember, what I need to do is I need to compare that to a value of alpha. My value of alpha is 0.05, so I can tell that my p-value is smaller than my value of alpha, which means that I can reject the null hypothesis, giving me significant evidence for the alternative hypothesis.
So in step 4, I need to reject or fail to reject and draw a conclusion. So I will say since p-value is less than alpha, reject the null hypothesis. And then what I can say is that there is significant evidence to conclude that the daily mean caffeine consumption for US women is greater than 200 milligrams.
So there is significant evidence to conclude that the daily mean caffeine consumption for US women is greater than 200 milligrams. So since I have had a sample mean that was significantly above my mean in my null hypothesis, I have evidence to conclude that the alternative hypothesis is true. So I have evidence to conclude that the daily mean caffeine consumption is greater than 200 milligrams for this population.
All right. That has been your tutorial on t-tests. Thanks for watching.