Skip to main content
Statistics LibreTexts

8.3: z-Test for a Mean

  • Page ID
    58293
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives
    • Understand when to use a Z-test in hypothesis testing.
    • Recognize that a z-test is appropriate when the population standard deviation is known and the sample size is large or the population is normally distributed.
    • Learn to apply the critical value method by comparing the test statistic to the critical cutoff value.
    • Learn to apply the p-value method by comparing the p-value to the significance level (α) to make a decision.
    • Develop the ability to interpret results using both the critical value and p-value methods.

    The z-test for a mean is a statistical method used to determine whether a sample mean significantly differs from a known population mean. It is typically used when the population standard deviation is known and the sample size is sufficiently large (usually \(n \geq 30\) ). The test calculates a z-score, which measures how many standard deviations the sample mean is from the population mean under the null hypothesis. This z-score is then compared to a critical value based on the chosen significance level to decide whether to reject the null hypothesis. The z-test helps researchers make data-driven conclusions about population means.

    The Traditional Method (Critical Value Method)

    There are five steps in hypothesis testing when using the traditional method:

    1. Identify the claim and formulate the hypotheses.
    2. Find the critical value(s) and state the rejection rule (the rule by which you will reject the null hypothesis (H0).
    3. Compute the test statistic.
    4. Decide to reject or not reject the null hypothesis by comparing the test statistic to the critical value(s). Reject H0 when the test statistic is in the critical tail(s).
    5. Summarize the results and address the claim using context and units from the research question.

    Note: The test statistic and the critical value(s) come from the same distribution and will usually have the same letter, such as z, t, or F. The critical value(s) will have a subscript with the lower tail area \((z_{\alpha}, z_{1–\alpha}, z_{\alpha / 2})\) or an asterisk next to it (z*) to distinguish it from the test statistic.

    You can find the critical value(s) or test statistic in any order, but make sure you know the difference when you compare the two. The critical value is found from \( \alpha \) and is the start of the shaded area called the critical region (also called the rejection region or area). The test statistic is computed using sample data and may or may not be in the critical region.

    The critical value(s) is set before you begin (a priori) by the level of significance you are using for your test. This critical value(s) defines the shaded area known as the rejection area. The test statistic for this example is the z-score we find using the sample data that is then compared to the shaded tail(s). When the test statistic is in the shaded rejection area, you reject the null hypothesis. When your test statistic is not in the shaded rejection area, then you fail to reject the null hypothesis. Depending on whether your claim is null or the alternative, the sample data may or may not support your claim.

    8.3.1 z-Test

    When the population standard deviation is known and stated in the problem, we will use the z-test.

    Definition: z-Test When Population Standard Deviation Is Given

    The z-test is a statistical test for the mean of a population. It can be used when σ is known. The population should be approximately normally distributed when n < 30.

    When using this model, the test statistic is \(z =\dfrac{\bar{x}-\mu}{\left(\dfrac{\sigma}{\sqrt{n}}\right)}\) where µ is the test value from the H0.

    Example \(\PageIndex{1}\) z-Test Using Traditional (Critical Value) Method

    M&Ms candies advertise a mean weight of 0.8535 grams. A sample of 50 M&M candies is randomly selected from a bag of M&Ms and the mean is found to be \(\overline{ x }\) = 0.8472 grams. The standard deviation of the weights of all M&Ms is (somehow) known to be σ = 0.06 grams. A skeptic M&M consumer claims that the mean weight is less than what is advertised. Test this claim using the traditional method of hypothesis testing. Use a 5% level of significance.

    Solution

    By letting \(\alpha\) = 0.05, we are allowing a 5% chance that the null hypothesis (average weight that is at least 0.8535 grams) is rejected when in actuality it is true.

    1. State the Hypothesis and Identify the Claim: The claim is “M&Ms candies have a mean weight that is less than 0.8535 grams.” This translates mathematically to µ < 0.8535 grams. Therefore, the null and alternative hypotheses are:

    H0: µ = 0.8535

    H1: µ < 0.8535 (claim)

    This is a left-tailed test since the alternative hypothesis has a “less than” sign.

    We are performing a test of the population mean. We can use the z-test because we were given a population standard deviation σ (not a sample standard deviation s). In practice, σ is rarely known and usually comes from a similar study or previous year’s data.

    2. Find the Critical Value: The critical value for a left-tailed test with \(\alpha\) = 0.05 can be found by using the Standard Normal Distribution Table. Look up \(\alpha\) = 0.05 in the one-tail row, and locate the critical value at the very bottom of the table in the z-row. Since the test is left-tailed, the critical value will be a negative value from what appears in the table. It is –1.65.

    The standard normal distribution table shows –1.65 as the critical value.

    Figure \(\PageIndex{1}\): The Table for Z and T Values

    3. Compute the Test Statistic: The formula for the test statistic is the z-score that we used back in the Central Limit Theorem section \(z=\dfrac{\bar{x}-\mu_{0}}{\left(\dfrac{\sigma}{\sqrt{n}}\right)}=\dfrac{0.8472-0.8535}{\left(\dfrac{0.06}{\sqrt{50}}\right)}=-0.74\).

    4. Make the Decision: The test point –0.74 falls in the non-critical region. Therefore, do not reject the null hypothesis (H0).

    The test point -0.74 falls in the non-critical region.
    Figure \(\PageIndex{2}\): Standard Normal Distribution Graph. C.V. line is -1.65, and the Test Value z is -0.74 and Lands in the Non-Critical Region

    5. Summarize the Results: At \(\alpha\) = 0.05, there is not enough evidence to support the claim that the mean weight is less than 0.8535 grams.

    Example 8-5 used the traditional critical value method. With the onset of computers, this method is outdated, and the p-value and confidence interval methods are becoming more popular.

    Most statistical software packages will give a p-value and confidence interval, but not the critical value.

    TI-84: Press the [STAT] key, go to the [TESTS] menu, arrow down to the [Z-Test] option, and press the [ENTER] key. Arrow over to the [Stats] menu and press the [ENTER] key. Then type in the value for the hypothesized mean (µ0), standard deviation, sample mean, sample size, arrow over to the \(\neq\), <, > sign that is in the alternative hypothesis statement then press the [ENTER] key, arrow down to [Calculate] and press the [ENTER] key. Alternatively (If you have raw data in a list) Select the [Data] menu and press the [ENTER] key. Then type in the value for the hypothesized mean (µ0), and type in your list name (TI-84 L1 is above the 1 key).

    Input for z-Test in TI-84+ calculator.

    Figure \(\PageIndex{3}\): Input for z-Test in TI-84+ Calculator.

    Press the [STAT] key, go to the [TESTS] menu, arrow down to either the [Z-Test] option, and press the [ENTER] key. Arrow over to the [Stats] menu and press the [ENTER] key. Then type in the value for the hypothesized mean (µ0), standard deviation, sample mean, sample size, arrow over to the \(\neq\), <, > sign that is in the alternative hypothesis statement then press the [ENTER] key, arrow down to [Calculate] and press the [ENTER] key. Alternatively, if you have raw data in a list) select the [Data] menu and press the [ENTER] key. Then type in the value for the hypothesized mean (µ0), and type in your list name (TI-84 L1 is above the 1 key).

    Output for z-Test in TI-84+ calculator.

    Figure \(\PageIndex{4}\): Output for z-Test in TI-84+ Calculator.

    The calculator returns the alternative hypothesis (check and make sure you selected the correct sign), the test statistic, the p-value, the sample mean, and the sample size.

    Example \(\PageIndex{2}\) z-Test Using a Table (Traditional Method)

    An educational researcher wants to determine if the average cost of textbooks for Citrus College students is more than $500 per semester. A random sample of 36 students is selected, and their average textbook cost is found to be $520, with a population standard deviation of $60. Test the researcher's claim at \(\alpha\) = 0.05.

    Solution

    1. State the Hypothesis and Identify the Claim: “The average cost of textbooks for Citrus College students is more than $500 per semester.” This translates mathematically to µ > $500. Therefore, the null and alternative hypotheses are:

    H0: µ = $500

    H1: µ > $500 (claim)

    This is a right-tailed test since the alternative hypothesis has a “greater than” sign.

    We are performing a test of the population mean. We can use the z-test because we were given a population standard deviation σ (not a sample standard deviation s). In practice, σ is rarely known and usually comes from a similar study or the previous year’s data.

    2. Find the Critical Value: To find the critical value for a right-tailed test, use the table below.

    The standard normal distribution table shows –1.65 as the critical value.

    Figure \(\PageIndex{8}\): The Table for Z and T Values

    Since \(\alpha\) = 0.05 and the test is right-tailed, the critical value will be positive, and it will be 1.65.

    3. Compute the Test Statistic: The formula for the test statistic is the z-score that we used back in the Central Limit Theorem section \(z =\dfrac{\bar{x}-\mu_{0}}{\left(\dfrac{\sigma}{\sqrt{n}}\right)}=\dfrac{520-500}{\left(\dfrac{60}{\sqrt{36}}\right)}=2\).

    4. Make the Decision: Since the test point of 2.00 falls in the critical region, reject the null hypothesis (H0).

    Right-tailed normal distribution curve Where C.V. =1.65 and z =2.00 falls in the critical region.
    Figure \(\PageIndex{9}\): Right-Tailed Standard Normal Distribution Curve Where C.V. =1.65 and Test Value z =2.00 Lands in the Critical Region.

    5. Summarize the Results: There is enough evidence to support the claim that the average cost of textbooks for Citrus College students is more than $500 per semester.

    The P-Value Method

    Most modern statistics and research methods utilize this method with the advent of computers and graphing calculators.

    There are five steps in hypothesis testing when using the p-value method:

    1. Identify the claim and formulate the hypotheses.
    2. Compute the test statistic.
    3. Compute the p-value.
    4. Decide to reject or not reject the null hypothesis by comparing the p-value with \(\alpha\). Reject H0 when the p-value ≤ \(\alpha\).
    5. Summarize the results and address the claim.

    The ideas below review the process of evaluating hypothesis tests with p-values:

    • The null hypothesis represents a skeptic’s position or a position of no difference. We reject this position only if the evidence strongly favors the alternative hypothesis.
    • A small p-value means that if the null hypothesis is true, there is a low probability of seeing a point estimate at least as extreme as the one we saw. We interpret this as strong evidence in favor of the alternative hypothesis.
    • The p-value is constructed in such a way that we can directly compare it to the significance level (\(\alpha\)) to determine whether to reject H0. We reject the null hypothesis if the p-value is smaller than the significance level, \(\alpha\), which is usually 0.05. Otherwise, we fail to reject H0.
    • We should always state the conclusion of the hypothesis test in plain language and use context and units so non-statisticians can also understand the results.

    What is the p-value?

    The p-value is the probability of observing an effect as extreme as that in your sample data, assuming that the null hypothesis is true. The p-value is calculated based on the assumption that the null hypothesis is true for the population and that the difference in the sample is caused entirely by random chance.

    Recall the example at the beginning of the chapter.

    Example \(\PageIndex{3}\) z-Test Using TI-84 Graphing Calculator (P-Value Method)

    Suppose a manufacturer of a new laptop battery claims the mean life of the battery is 900 days with a standard deviation of 40 days. You are the buyer of this battery, and you think this claim is inflated. You would like to test your belief because, without a good reason, you cannot get out of your contract. You take a random sample of 35 batteries and find that the mean battery life is 890 days. Test the claim using the p-value method. Let \(\alpha\) = 0.05.

    Solution

    We had the following hypotheses:

    1. State the Hypothesis and Identify the Claim: State the claim and determine H0 and H1.

    H0: μ = 900, since the manufacturer says the mean life of a battery is 900 days.

    H1: μ < 900, since you believe the mean life of the battery is less than 900 days.

    1. Compute the Test Statistic: Compute the test statistic using sample data.

    The test statistic was found to be: \(z =\dfrac{\bar{x}-\mu_{0}}{\left(\dfrac{\sigma}{\sqrt{n}}\right)}=\dfrac{890-900}{\left(\dfrac{40}{\sqrt{35}}\right)}=-1.479\).

    1. Find the P-Value: The p-value is computed using the tail area of the test point. If the test has one tail, as in this example, the tail area equals the p-value.

    The p-value is P(\(\overline{ x }\) < 890 | H0 is true) = P(\(\overline{ x }\)< 890 | μ = 900) = P(Z < –1.48).

    Looking up the left tail area for z = –1.48 in the standard normal distribution is 0.0694. Thus, the p-value = 0.0694.

    The test Point with z = -1.48 and left tail area of 0.0694

    Figure \(\PageIndex{5}\): The Test Point with z = -1.48 and Left Tail Area of 0.0694.

    Alternatively, the p-value can be computed using a TI-84+ graphing calculator. Input the data using the steps mentioned in the previous example.

    Input for z-Test in TI-84+ calculator.

    Figure \(\PageIndex{6}\): Input for z-Test in TI-84+ Calculator.

    The TI calculators will easily find the p-value for you. This value may differ slightly from the table due to rounding on the z-value.

    Output for z-Test in TI-84+ calculator.

    Figure \(\PageIndex{7}\): Output for z-Test in TI-84+ Calculator.

    1. Make the Decision: Reject or not reject the null hypothesis by comparing the p-value with \(\alpha\). Now compare the p-value = 0.0696 (TI-84+) or 0.0694 (From Standard Normal Distribution Table) to \(\alpha\) = 0.05. Reject H0 when the p-value ≤ α, and do not reject H0 when the p-value > \(\alpha\). The p-value for this example is larger than alpha 0.0696 > 0.05, therefore, the decision is not to reject H0.
    2. Summarize the Results: Since the null hypothesis is not rejected, there is not enough evidence to indicate that the mean life of the battery is less than 900 days.

    Exercises

    1. A particular brand of tires claims that its deluxe tire averages more than 50,000 miles before it needs to be replaced. The population standard deviation for this particular brand of tire is known to be 8,000 miles. A survey of the owners of that tire design was conducted. The mean lifespan of the 28 tires surveyed was 53,000 miles. Using \(\alpha = 0.05\), is the data highly inconsistent with the claim? Use the traditional method.

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. The cost of a daily newspaper varies from city to city. The standard deviation of daily newspaper cost is $0.20. A study was done to test the claim that the mean cost of a daily newspaper is $1.00. Twelve randomly chosen daily newspapers yield a mean cost of $0.95. Does the data support the claim at \(\alpha = 0.01 \)? Use the traditional method.

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. The staff at the CineGalaxy Megaplex claims that the average movie run time at their theater is 120 minutes. However, a group of dedicated film buffs—the Reel Time Reviewers—suspect that the movies have been getting shorter. To investigate, they randomly sampled 36 movies screened at CineGalaxy over the past month and found that the average run time is 115 minutes. From past data, they know the population standard deviation of movie runtimes is 10 minutes. The Reel Time Reviewers decided to run a z-test using \(\alpha = 0.01\) to determine if the average movie length at CineGalaxy is less than 120 minutes. Use the traditional method.

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. A professor at Citrus College believes that the average number of hours students in her Statistics class spend on homework each week is less than 15 hours. To investigate, she surveys a random sample of 40 students and finds that the average weekly homework time is 13.8 hours. Based on previous data, the population standard deviation is known to be 4 hours. Using the p-value method, test the professor’s claim at \(\alpha = 0.10\).

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    1. The average number of dogs owned per household in the U.S. is reported to be 1.6 dogs, with a population standard deviation of 0.5 dogs. A researcher believes that the average number of dogs owned per household is different from 1.6. To test this claim, they surveyed a random sample of 50 households and found the sample mean to be 1.8 dogs. Using the p-value method, test the researcher's claim using \(\alpha = 0.025\).

    Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
    MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.

    QR code linking to the MyOpenMath version of the question above with step-by-step guided problem-solving.

    Answers

    If you are an instructor and want the solutions to all the exercise questions for each section, please email Toros Berberyan.


    This page titled 8.3: z-Test for a Mean is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Toros Berberyan, Tracy Nguyen, and Alfie Swan via source content that was edited to the style and standards of the LibreTexts platform.