Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

Z-Test for Population Means

Author: Sophia

what's covered
This tutorial will cover how to perform a z-test for population means. Our discussion breaks down as follows:

Table of Contents

1. Calculating a Z-Test for Population Means

A z-test for population means is a type of hypothesis test that compares a hypothesized mean from the null hypothesis to a sample mean. This can be used with quantitative data and when the population standard deviation is known.

This type of z-test is not done often because it is unlikely that we would know the population standard deviation without knowing the population mean.

When calculating a z-test for population means, you need the following information:

  • Population mean (μ)
  • Population standard deviation (σ)
  • Sample mean (x̅)
  • Sample size (n)
This information will be plugged into the formula for a z-statistic of population means:

formula to know
Z-Statistic for Population Means
z equals fraction numerator x with bar on top minus mu over denominator begin display style fraction numerator sigma over denominator square root of n end fraction end style end fraction

IN CONTEXT

The average weight of newborn babies is 7.2 pounds, with a standard deviation of 1.1 pounds. A local hospital has recorded the weights of all 285 babies born in a month, and the average weight was 6.9 pounds.

Find the z-test statistic for this data set.

We know the average weight is 7.2 pounds, with a standard deviation of 1.1 pounds. Because we know the population standard deviation and it is quantitative data, we can use the normal distribution and find a z-score. We also know the average weight was 6.9 pounds. We can plug this information into the following formula to calculate our z-test statistic:

table attributes columnalign left end attributes row cell x with italic bar on top italic equals s a m p l e italic space m e a n italic equals italic 6 italic. italic 9 end cell row cell mu italic equals p o p u l a t i o n italic space m e a n italic equals italic 7 italic. italic 2 end cell row cell sigma italic equals p o p u l a t i o n italic space s t a n d a r d italic space d e v i a t i o n italic equals italic 1 italic. italic 1 end cell row cell n italic equals s a m p l e italic space s i z e italic equals italic 285 end cell row blank row cell z italic equals fraction numerator x with italic bar on top italic minus mu over denominator begin display style fraction numerator sigma over denominator square root of n end fraction end style end fraction italic equals fraction numerator italic 6 italic. italic 9 italic minus italic 7 italic. italic 2 over denominator begin display style fraction numerator italic 1 italic. italic 1 over denominator square root of italic 285 end fraction end style end fraction italic equals fraction numerator italic short dash italic 0 italic. italic 3 over denominator begin display style fraction numerator italic 1 italic. italic 1 over denominator square root of italic 285 end fraction end style end fraction italic equals fraction numerator italic short dash italic 0 italic. italic 3 over denominator begin display style fraction numerator italic 1 italic. italic 1 over denominator italic 16 italic. italic 88 end fraction end style end fraction italic equals fraction numerator italic short dash italic 0 italic. italic 3 over denominator italic 0 italic. italic 6516 end fraction italic equals italic short dash italic 4 italic. italic 604 end cell end table

We have 6.9, which is our sample mean, minus the population mean of 7.2, divided by the population standard deviation, 1.1, divided by the square root of our sample size, 285. This gives us a z-test statistic of negative 4.604. We should expect to get a negative z-score because our sample mean was less than the population mean.

If we were to put this on a normal distribution, it's centered at the population mean, which is 7.2 pounds. The average weight of the babies at the hospital was 6.9, which is less than 7.2 pounds, so it should fall in the lower part of our distribution.

Z-test for -4.604

The corresponding z-score is all the way down at the negative 4.604. At this hospital, the average weight of the babies was definitely far below the average weights of the babies of the population.

hint
Technology is often used when conducting a z-test for population means.

term to know
Z-Test for Population Means
A hypothesis test that compares a hypothesized mean from the null hypothesis to a sample mean, when the population standard deviation is known.


2. Conducting a Z-Test for Population Means

There are four parts to running any hypothesis test. This is regardless of the type of tests that you use.

step by step
Step 1: State the null and alternative hypotheses.

Step 2: Check the conditions necessary in order to actually perform the inference that you're trying to do.

Step 3: Calculate the test statistic--in this case, a z-statistic--and calculate the p-value based on the normal sampling distribution.

Step 4: Compare your test statistic to your chosen critical value or your p-value to our chosen significance level. Those are both acceptable approaches. Based on how they compare, state a decision regarding the null hypothesis. Circle it back around to the null hypothesis and decide if it supports the null hypothesis or refutes the hypothesis. Make a decision to either reject or fail to reject it based on your evidence. It should also be in the context of the problem.

EXAMPLE

Consider the following problem:

According to their packaging, the standard bag of M&M's candies contains 47.9 grams. Suppose you take 14 bags at random and weigh them. The sample mean is 48.07 grams.
48.2 48.4 47.0 47.3 47.9 48.5 49.0
48.3 48.0 47.9 48.7 48.8 47.4 47.6

Assuming the distribution of bag weights is approximately normal, and the standard deviation of all M&M's bags is 0.22 grams, is this evidence that the bags do not contain the claimed amount of 47.9 grams in each bag?

This could mean that it's either higher than 47.9 grams or lower than 47.9 grams. If you take a look, some of the weights in the sample are fairly off, some by almost a full gram.

You are also assuming that you know the standard deviation of all M&M's bags, which is not always a reasonable assumption, but is for this example.


Let's walk through each of the steps of running a hypothesis test with our M&M's example.

step by step

Step 1: State the null and alternative hypotheses.

For this problem, the null hypothesis is that the M&M's bags are doing exactly what you thought they would do. The mean of all M&M's bags is the 47.9 grams that was claimed.

The alternative hypothesis is that they're not that number. This is going to be a two-sided test based on this "not equal to" symbol.

You should also state what your alpha level or significance level is going to be. By stating that alpha equals 0.05, which is the most common significance level, you are saying if the p-value is less than 0.05, reject the null hypothesis. If this is above 0.05, you should fail to reject it.

table attributes columnalign left end attributes row cell H subscript 0 colon thin space mu equals 47.9 semicolon space T h e space m e a n space o f space a l l space M & M apostrophe s space b a g s space i s space 47.9 space g end cell row cell H subscript a colon thin space mu not equal to 47.9 semicolon space T h e space m e a n space o f space a l l space M & M apostrophe s space b a g s space i s space n o t space 47.9 space g end cell row cell alpha equals 0.05 end cell end table

Step 2: Check the conditions necessary for inference.

Look at the conditions necessary for inference on a population mean.

Criteria Description
Randomness How were the data collected?

The randomness should be stated somewhere in the problem. Think about the way the data was collected.
Independence Population ≥ 10n

You want to make sure that the population is at least 10 times as large as the sample size. This was your workaround for independence. If the population is sufficiently large, then taking out the number of bags that you took doesn't make a huge difference.
Normality n ≥ 30 or normal parent distribution

There are two ways to verify normality. Either the parent distribution has to be normal or the central limit theorem is going to have to apply. The central limit theorem says that for most distributions, when the sample size is greater than 30, the sampling distribution will be approximately normal.

Going back to the M&M's example:
  • Randomness: In the problem, it does say the bags were randomly selected. So, thinking about the way that the data was collected in the problem is important.
  • Independence: We can also assume there are at least 140 bags of M&M's, which is a reasonable assumption. Why 140? Because there were 14 bags in our sample. So you're going to assume that the population of all bags of M&M's is at least 10 times that size.
  • Normality: Finally, the distribution of bag weights is in fact approximately normal as stated in the problem.
Step 3: Calculate the test statistic and calculate the p-value based on the normal sampling distribution.

In this problem, your test statistic is going to be a z-statistic. How is this done? Take the sample mean minus the hypothesized population mean of 47.9 from the null hypothesis, and divide by the standard error, which is the standard deviation of the population divided by the square root of sample size.

begin mathsize 18px style table attributes columnalign left end attributes row cell z equals fraction numerator x with bar on top minus mu over denominator begin display style fraction numerator sigma over denominator square root of n end fraction end style end fraction equals fraction numerator 48.07 minus 47.9 over denominator begin display style fraction numerator 0.22 over denominator square root of 14 end fraction end style end fraction end cell row cell space space space space space space space space space space space space space space space space space equals plus 2.89 end cell end table end style

When you do all of that and input the numbers, you get a z-statistic of positive 2.89. Look at where that lies on the normal distribution that you're using. A z-statistic of 2.89 on the standard normal distribution centered at 0 is between two and three standard deviations above the mean. Because this is a two-sided test, find the probability that your z-statistic is above positive 2.89 and the probability that it's below negative 2.89.

Use a z-table to find the probability of 0.0019 for a z-score of -2.89.

z 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
-3.4 0.0003 0.0003 0.0003 0.0003 0.0003 0.0003 0.0003 0.0003 0.0003 0.0002
-3.3 0.0005 0.0005 0.0005 0.0004 0.0004 0.0004 0.0004 0.0004 0.0004 0.0003
-3.2 0.0007 0.0007 0.0006 0.0006 0.0006 0.0006 0.0006 0.0005 0.0005 0.0005
-3.1 0.0010 0.0009 0.0009 0.0009 0.0008 0.0008 0.0008 0.0008 0.0007 0.0007
-3.0 0.0013 0.0013 0.0013 0.0012 0.0012 0.0011 0.0011 0.0011 0.0010 0.0010
-2.9 0.0019 0.0018 0.0017 0.0017 0.0016 0.0016 0.0015 0.0015 0.0014 0.0014
-2.8 0.0026 0.0025 0.0024 0.0023 0.0023 0.0022 0.0021 0.0021 0.0020 0.0019
-2.7 0.0035 0.0034 0.0033 0.0032 0.0031 0.0030 0.0029 0.0028 0.0027 0.0026
-2.6 0.0047 0.0045 0.0044 0.0043 0.0041 0.0040 0.0039 0.0038 0.0037 0.0036
-2.5 0.0062 0.0060 0.0059 0.0057 0.0055 0.0054 0.0052 0.0051 0.0049 0.0048

That probability, when doubled, gives us 0.0038.

table attributes columnalign left end attributes row cell 2 left square bracket P left parenthesis z less than negative 2.89 right parenthesis right square bracket equals 2 left parenthesis 0.0019 right parenthesis end cell row cell space space space space space space space space space space space space space space space space space space space space space space space space space space space space equals 0.0038 end cell end table

Step 4: Compare your test statistic to your chosen critical value or your p-value to our chosen significance level.

This actually contains three parts: the comparison, the decision, and the conclusion. Since your p-value of 0.0038 is less than the significance level of 0.05, your decision is to reject the null hypothesis. There is evidence to conclude that the M&M's bags are not filled to a mean of 47.9 grams.
  • Comparison: 0.0038 < 0.05
  • Decision: Reject the null hypothesis
  • Conclusion: There is evidence to conclude that the m&m bags are not filled to the mean of 47.9 grams.

summary
The steps in any hypothesis test--not just a z-test for population means--are the same. First, state the null and alternative hypotheses both in symbols and in words. Second, state and verify the conditions necessary for inference. Third, calculate the test statistic from your statistics that you have and calculate its p-value. Finally, compare your p-value to the alpha level that you've chosen, or your test statistic to the critical value, and make a decision about the null hypothesis. State your conclusion in the context of the problem. In a z-test for population means, the population standard deviation must be known. That is not very common. You'll have other ways to address it when you don't know the population standard deviation. Since the test statistic is a z, this focuses on a z-test for population means.

Good luck!

Source: THIS TUTORIAL WAS AUTHORED BY JONATHAN OSTERS FOR SOPHIA LEARNING. PLEASE SEE OUR TERMS OF USE.

Z-Tables

/
Terms to Know
Z-Test for Population Means

A hypothesis test that compares a hypothesized mean from the null hypothesis to a sample mean, when the population standard deviation is known.

Formulas to Know
Z-Statistic for Population Means

z space equals space fraction numerator x with bar on top space minus space mu over denominator begin display style bevelled fraction numerator sigma over denominator square root of n end fraction end style end fraction