Skip to main content
Statistics LibreTexts

8.4: t-Test for a Mean

  • Page ID
    58294
  • \( \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 t-test in hypothesis testing.
    • Recognize that a t-test is appropriate when the population standard deviation is unknown and the sample size is small.
    • Learn that the T-test relies on the T-distribution to account for additional variability in small samples.
    • Apply the critical value method by comparing the test statistic to a t-value from the t-distribution.
    • Use the result of the comparison to decide whether to reject the null hypothesis.

    t-Test for the Mean

    The one-sample t-test is a statistical method used to determine whether the average of a single sample is significantly different from a known or assumed population mean. It’s especially useful when the population standard deviation is unknown and the sample size is relatively small.

    This test is commonly applied in a variety of fields. For example, in education, researchers might test whether the average test score of a new teaching method differs from the national average. In healthcare, a doctor may want to check if a new treatment changes average blood pressure levels compared to a standard value. In manufacturing, a company might use the t-test to see if the average weight of a product batch matches the target specification.

    There are two main approaches to making a decision with the t-test:

    • The traditional method compares the calculated test statistic to a critical value from the t-distribution.
    • The p-value method assesses how likely the observed result would be if the null hypothesis were true.

    Both approaches lead to the same conclusion—either rejecting or not rejecting the null hypothesis based on the evidence provided by the sample.

    When the population standard deviation is unknown, we will use the t-test.

    Definition: t-Test for the Mean

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

    When using this model, the test statistic is \(t=\dfrac{\bar{X}-\mu}{\left(\dfrac{s}{\sqrt{n}}\right)}\) where µ is the test value from the H0. The degrees of freedom are d.f. = n – 1.

    The z and t-tests are easy to mix up. Sometimes, a standard deviation will be stated in the problem without specifying if it is a population’s standard deviation σ or the sample standard deviation s. If the standard deviation is in the same sentence that describes the sample or only raw data is given, then this would be s. When you only have sample data, use the t-test.

    Chart that demonstrates when to use the z or t test.

    Figure \(\PageIndex{1}\): Flow Chart that demonstrates when to use the z or t-test.

    Use the figure below as a guide in setting up your hypotheses. The two-tailed test will always have a not equal ≠ sign in H1 and both tails shaded. The right-tailed test will always have the greater than > sign in H1 and the right tail shaded. The left-tailed test will always have a less than < sign in H1 and the left tail shaded.

    Types of test based on hypothesis test and key words.

    Figure \(\PageIndex{2}\): Types of Test Based on Hypothesis Test and Key Words.

    Example \(\PageIndex{1}\) Traditional t-test

    A real estate researcher is analyzing data on frequent movers. The researcher believes that people are becoming less mobile and settling down earlier in life. She claims that the average person used to live in is now less than 6 different homes by the age of 30. But she suspects that number is dropping.

    To test this, she randomly surveyed 15 people under the age of 30 and recorded the number of different homes each person had lived in:

    Data (number of homes):
    4, 5, 3, 6, 5, 4, 5, 6, 3, 4, 4, 5, 4, 3, 4

    Test the researcher's claim using \(\alpha = 0.05.\)

    Solution
    1. State the hypotheses and identify the claim: The statement “the average is less than (<) than 6” must be in the alternative hypothesis. Therefore, the null and alternative hypotheses are:

    H0: µ = 6

    H1: µ < 6 (claim)

    This is a left-tailed test with the claim in the alternative hypothesis.

    1. Find the critical value using the t-distribution table. To find the critical value, use the degrees of freedom and \(\alpha = 0.05.\).

    The degrees of freedom is d.f. = 15 - 1 = 14. There are 15 data values.

    The critical value is –1.761.

    1. Compute the test statistic: We are using the t-test because we are performing a test about a population mean. We must use the t-test (instead of the z-test) because the population standard deviation σ is unknown. Also, we must compute the sample mean and sample standard deviation using the data.

    Using a calculator to compute \( \bar{X}\) = 4.333 and s = 0.961 after being rounded to three place values.

    \(t=\dfrac{\bar{X}-\mu}{\left(\dfrac{s}{\sqrt{n}}\right)}\) = \(\dfrac{4.333- 6}{\left(\dfrac{0.961}{\sqrt{15}}\right)}\) = –6.73

    1. State the decision. Decision: Since the test statistic t =-6.73 is in the critical region, we should reject H0.
    The t-value = –6.73 falls in the critical region.
    Figure \(\PageIndex{3}\): The t-value = –6.73 Falls in the Critical Region.
    1. State the summary. There is enough evidence to support the researcher's claim that the average number of homes people have lived in is now less than 6.
    Example \(\PageIndex{2}\) Traditional t-test

    A career research analyst claims that recent graduates in STEM (Science, Technology, Engineering, and Mathematics) fields earn an average starting income of $68,000. However, a university career center believes that this figure might be off and decides to conduct an investigation. They randomly surveyed a sample of 25 recent STEM graduates from their university. The results show that the average income of the sample is $70,200, with a sample standard deviation of $6,000. At \(\alpha = 0.10\), test the career center’s belief that the average starting income differs from $68,000. Use the traditional method.

    Solution
    1. State the Hypotheses and Identify the Claim: The statement “the income differs ( ≠ ) than $68,000” must be in the alternative hypothesis. Therefore, the null and alternative hypotheses are:

    H0: µ = 68,000

    H1: µ ≠ 68,000 (claim)

    This is a two-tailed test with the claim in the alternative hypothesis.

    1. Find the Critical Values: Use the t-distribution table to find the critical value with the degrees of freedom and \(\alpha = 0.10\).

    The degrees of freedom is d.f. = 25 - 1 = 24. There are 25 data values.

    The critical value is ±1.711.

    1. Compute the Test Statistic: We are using the t-test because we are performing a test about a population mean. We must use the t-test (instead of the z-test) because the population standard deviation σ is unknown. Also, we must compute the sample mean and sample standard deviation using the data.

    Using a calculator to compute \( \bar{X}\) = 70,200 and s = 6,000.

    \(t=\dfrac{\bar{X}-\mu}{\left(\dfrac{s}{\sqrt{n}}\right)}\) = \(\dfrac{70,200 - 68,000}{\left(\dfrac{6,000}{\sqrt{25}}\right)}\) = 1.83

    1. Make the Decision: Since the test statistic t =1.83 is in the critical region, we should reject H0.
    The t-value = 1.83 falls in the  critical region.
    Figure \(\PageIndex{4}\): The t-value = 1.83 Falls in the Critical Region.
    1. Summarize the Results: There is enough evidence to support the analyst's claim that the average income differs from $68,000.
    Example \(\PageIndex{3}\) Traditional t-test

    With California’s housing market known for its sky-high prices, a housing advocacy group claims that the average monthly rent statewide is $2,300. However, a skeptical tenant rights organization believes that rent may be climbing even higher than reported. To test this belief, the organization surveyed a random sample of 20 California renters. The survey results show that the average monthly rent paid by the sample is $2,480, with a sample standard deviation of $300. At \( \alpha = 0.01\), test the organization's claim that the average rent is greater than $2,300.

    Solution
    1. State the Hypotheses and Identify the Claim: The statement “the rent is greater than ( > ) $2,300” must be in the alternative hypothesis. Therefore, the null and alternative hypotheses are:

    H0: µ = 2,300

    H1: µ > 2,300 (claim)

    This is a right-tailed test with the claim in the alternative hypothesis.

    1. Find the Critical Values: Use the t-distribution table to find the critical value with the degrees of freedom and \(\alpha = 0.01.\).

    The degrees of freedom is d.f. = 20 - 1 = 19. There are 19 data values.

    The critical value is 2.539.

    1. Compute the Test Statistic: We are using the t-test because we are performing a test about a population mean. We must use the t-test (instead of the z-test) because the population standard deviation σ is unknown. Also, we must compute the sample mean and sample standard deviation using the data.

    Using a calculator to compute \( \bar{X}\) = 2,480 and s = 300.

    \(t=\dfrac{\bar{X}-\mu}{\left(\dfrac{s}{\sqrt{n}}\right)}\) = \(\dfrac{2,480 - 62,300}{\left(\dfrac{300}{\sqrt{20}}\right)}\) = 2.68

    1. Make the Decision: Since the test statistic t =2.68 is in the critical region, we should reject H0.
    The t-value = 2.68 falls in the critical region.
    Figure \(\PageIndex{5}\): The t-value = 2.68 Falls in the Critical Region.
    1. Summarize the Results: There is enough evidence to support the organization's claim that the average monthly rent in California is greater than $2,300.

    P-Value Method

    Example \(\PageIndex{5}\) t-Test: P-value Method

    The label on a particular brand of cream of mushroom soup states that (on average) there is 870 mg of sodium per serving. A nutritionist would like to test if the average is more than the stated value. To test this, 13 servings of this soup were randomly selected, and the amount of sodium was measured. The sample mean was found to be 882.4 mg, and the sample standard deviation was 24.3 mg. Assume that the amount of sodium per serving is normally distributed. Test this claim using the traditional method of hypothesis testing. Use the \(\alpha\) = 0.05 level of significance.

    Solution
    1. State the Hypotheses and Identify the Claim: The statement “the average is more (>) than 870” must be in the alternative hypothesis. Therefore, the null and alternative hypotheses are:

    H0: µ = 870

    H1: µ > 870 (claim)

    This is a right-tailed test with the claim in the alternative hypothesis.

    1. Compute the Test Statistic: The test statistic is computed as follows, \(t=\dfrac{\bar{x}-\mu_{0}}{\left(\dfrac{S}{\sqrt{n}}\right)}=\dfrac{882.4-870}{\left(\dfrac{24.3}{\sqrt{13}}\right)}=1.8399\).
    2. Find the P-Value:

    We can use technology to get the test statistic and p-value.

    TI-84: If you have raw data, enter the data into a list before you go to the test menu. Press the [STAT] key, arrow over to the [TESTS] menu, arrow down to the [2:T-Test] option, and press the [ENTER] key. Arrow over to the [Stats] menu and press the [ENTER] key. Then type in the hypothesized mean (µ), sample or population standard deviation, the sample mean, sample size, arrow over to the \(\neq\), <, > sign that is the same as the problem’s alternative hypothesis statement then press the [ENTER] key, arrow down to [Calculate] and press the [ENTER] key. The calculator returns the t-test statistic and p-value.

    Steps to enter data into TI-84+ for t-test and output.
    Figure \(\PageIndex{6}\): Steps to Enter Data into TI-84+ for t-test and Output.

    Alternatively (If you have raw data in list one) Arrow over to the [Data] menu and press the [ENTER] key. Then type in the hypothesized mean (µ), L1, leave Freq:1 alone, arrow over to the \(\neq\), <, > sign that is the same in the problem’s alternative hypothesis statement then press the [ENTER] key, arrow down to [Calculate] and press the [ENTER] key. The calculator returns the t-test statistic and the p-value.

    1. Make the Decision: The rejection rule: reject the null hypothesis if the p-value ≤ \(\alpha\). Decision: Since the p-value = 0.0453 is less than \(\alpha\) = 0.05, we Reject H0. This agrees with the decision from the traditional method. (These two methods should always agree!)
    2. Summarize the Results: The summary remains the same as in the previous method. There is sufficient evidence to support the claim that the average amount of sodium per serving of cream of mushroom soup exceeds the stated 870 mg amount.

    Exercises

    1. A popular tech review site claims that the average price of graphing calculators purchased online is $85.00. However, a savvy online shopper believes that prices have increased due to a recent surge in demand during the back-to-school season. She collected a random sample of 12 graphing calculator prices from various online retailers to investigate. The sample has a mean price of $91.25 and a standard deviation of $2.87. Test the shopper's claim at \(\alpha = 0.05\). 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 popular tech review site claims that the average price of graphing calculators purchased online is $85.00. However, a savvy online shopper believes that prices have increased due to a recent surge in demand during the back-to-school season. She collected a random sample of 12 graphing calculator prices from various online retailers to investigate. The sample has a mean price of $91.25 and a standard deviation of $2.87. Test the shopper's claim at \(\alpha = 0.05\). Use the p-value 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 national career survey claims that the average person has 12 jobs during their lifetime. A researcher believes that this number has decreased in recent years due to longer job tenure and changes in career trends. To investigate, she collects a random sample of 10 individuals and records the number of jobs each has held so far in their lifetime. Test the researcher's claim at \(\alpha = 0.10\). Use the traditional method.

    Below are the results:

    10, 11, 9, 8, 12, 10, 7, 11, 9, 8

    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 national career survey claims that the average person has 12 jobs during their lifetime. A researcher believes that this number has decreased in recent years due to longer job tenure and changes in career trends. To investigate, she collects a random sample of 10 individuals and records the number of jobs each has held so far in their lifetime. Test the researcher's claim at \(\alpha = 0.10\). Use the p-value method.

    Below are the results:

    10, 11, 9, 8, 12, 10, 7, 11, 9, 8

    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 human resources analyst claims that Americans' average vacation time per year is 15 days. To evaluate this claim, a researcher collects data from a random sample of 20 working adults and finds that the sample has an average of 13.8 vacation days per year with a standard deviation of 2.40 days. Test the analyst's claim at the \(\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. A human resources analyst claims that Americans' average vacation time per year is 15 days. To evaluate this claim, a researcher collects data from a random sample of 20 working adults and finds that the sample has an average of 13.8 vacation days per year with a standard deviation of 2.40 days. Test the analyst's claim at the \(\alpha = 0.01\). Use the p-value 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.

    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.4: t-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.

    • Was this article helpful?