Hi. This tutorial covers the z-test for population means. So let's start with a definition. So the z-test for a population mean is the type of hypothesis test used to test an assumed population mean when the population standard deviation is known. So we're talking about when sigma is known, we're going to use this z-test. So while it's unlikely that we would know a population standard deviation without knowing the population mean, the z-test procedure is easier than if sigma is unknown.
So this is kind of a simplified procedure, because generally sigma is not going to be known. But in the case that it is, we will perform a z-test here. So there are four steps in a z-test for a population mean. I'm going to go through each of the four steps, and then we'll actually do the four steps with an example.
So step 1 is to formulate the null and alternative hypotheses and choose a significance level. Step 2, check that the conditions of the hypothesis test are met for the random sample you use. Step 3, calculate a test statistic and compare to a critical value or find the p-value. And then we're going-- and then step 4 is to decide whether to reject or not-- to reject or not to reject the null hypothesis and draw a conclusion.
All right, so like I said, let's take a look at an example and then actually go through those four steps. So suppose that it is known that sigma equals 55 for daily caffeine consumption in milligrams for the population of US women. So in this case, again, sigma is known. So we are going to do a z-test here. And the parameter that we're looking for is the average daily caffeine consumption for US women.
So based on random sample of n equal 60 women, it was found that the sample mean caffeine consumption is x bar equals 215-- so 215 milligrams of caffeine consumed per day for the sample of 60 women. So does this sample provide significant evidence that the mean caffeine consumption for US adult women is greater than 200 milligrams. So we're going to use this to help us write our hypotheses.
So let's go through those four steps for this example here. So we want our null and alternative hypotheses, then we also want to choose a significant level. So our null hypothesis is that mu equals 200. And our alternate hypothesis is that-- remember that we're trying to show, is there significant evidence that the average is more than 200 milligrams? So my alternate hypothesis is going to be greater than 200.
And now I want to choose a significance level. Remember, your significance level is also the probability of making a type one error. And the most common value of alpha there is 0.05. So let's just stick with that in this example. So that's step 1.
Step 2, now, we're going to check the conditions of the hypothesis test-- check that conditions of the hypothesis test are met for the random sample you used. We're actually just going to assume in this case that the conditions are met. There'll be another tutorial that goes through the conditions. But we're going to assume that our conditions are met. We're going to proceed with our z-test.
Step 3 is kind of the meaty step here is to calculate the test statistic and compare to a critical value or find the p-value. So the z-score formula is z equals x bar your sample mean minus mu-- mu is your hypothesized population mean-- divided by sigma sub x bar. So that's the standard deviation of the sample means. This is also sometimes known as the standard error. And now, that standard error kind of has its own formula. So the standard error is always the population standard deviation divided by the square root of n.
So let's actually go ahead and calculate that standard error, and then we'll use the standard error to calculate the z-score. So the standard error, sigma sub x bar, is going to be your population standard deviation. And remember, that was given to us as 55. And then we're going to divide by the sample size. So we know that there are 60 women in this study.
So now on my calculator, I'm going to actually calculate that standard error-- so 55 over the square root of 60. And that's going to give me about 7.1, almost right, almost exactly. So your standard error is about 7.1. Now what I'm going to do is use that standard error to calculate my z-score. So z is going to equal-- now it's my sample mean, which was 215, and I'm going to subtract now my hypothesized population mean. I hypothesized it to be 200. And now I'm going to divide by this standard error-- so 7.1
So I'll do that also in my calculator. So I'll do 215 minus 200. And then I'm going to divide by and I'm going to use my last answer feature to preserve accuracy with that standard error. So if I hit Enter there, it'll give me a z-score of about 2.112. So z equals 2.112.
So that's my test statistic. Now, what I need to do is either compare that to a critical value or find a p-value. What I'm going to do is find a p-value. So since I-- so a p-value is going to give me the probability of a test statistic of 2.112 2 or greater. Now, remember, I'm doing an upper-tail test. So I'm trying to show my p-value is going to be the probability of this or more.
So to calculate that p-value, I'm also going to use my calculator. And remember, the z-score matches up with the normal distribution. So what I'm going to do on my calculator is use a function called normal CDF. Now, normal CDF-- I'm going to type in my z score. And then what I'm going to do is I'm going to-- it takes two arguments. So the first argument is kind of my left-hand boundary. Now, the normal curve is theoretically an infinite distribution. So I want the area between 2.112 and infinity.
So even though I can't really-- you can't technically calculate that area. We know, since the area under the curve is equal to 1 or a probability of 1, this will give me the probability of 2.112 or more. So I'm going to use that 10 to the power of 99 as a way of representing positive infinity. So now, what that's going to give me then is a p-value of about 0.0173. So I'll write that down.
And now, remember, with that p-value, I need to compare it to my value of alpha. And remember that I picked my value of alpha to be 0.05. So what I'm going to do is compare that p-value to my alpha value. Since this p-value is smaller than alpha, that means I'm going to reject my null hypothesis, which I am going to then write up in step 4.
So in step 4, what I'm going to say here is that since p-value was less than alpha, we are going to reject the null hypothesis. And then we need to draw a conclusion, and I like to do that in the context of my problem. So what I would say is that there is significant evidence to conclude that the mean caffeine consumption for US women is greater than 200 milligrams.
So since the p-value is less than alpha, reject the null hypothesis, then being able to say there is significant evidence to conclude that the mean caffeine consumption for US women is greater than 200. And again, this conclusion was made assuming that the conditions in step 2 were met. All right, that concludes the tutorial on the z-test for population means. Thanks for watching.