9.4 Hypothesis T-Test for a Single Mean

In engineering, precise and accurate data analysis is crucial for making informed decisions, optimizing processes, and ensuring safety. When performing a hypothesis test of a single population mean [latex]\mu[/latex] using a normal distribution z-test, a simple random sample is taken from the population, the population is normally distributed or your sample size is sufficiently large, and the value of the population standard deviation is known. What is often the case is that the population standard deviation is not known, so it must be estimated. Due to the increased variation in the distribution of the sample statistic, the z-test is not an appropriate test, and we switch to the t-test, especially with small sample sizes. 


When dealing with small sample sizes, we have noted that the Student’s t-distribution accommodates the increased variability and uncertainty inherent in smaller datasets. In this case, the t-distribution provides a more accurate reflection of the true population parameters, enabling engineers to perform hypothesis testing and construct confidence intervals with greater reliability. This nuanced approach ensures that the conclusions drawn from statistical analyses are robust, even when data is limited.
When performing inference on a single population mean [latex]\mu[/latex] using a Student’s t-distribution, which is called a t-test, there are fundamental assumptions that need to be met in order for the test to be reliably used. The data should be a simple random sample that comes from a population that is approximately normally distributed and the sample standard deviation is used to approximate the population standard deviation.

t-Test for a Single Population Mean

When performing a hypothesis test involving a single population mean μ, the underlying sampling distribution of the [latex]\bar{x}[/latex] is the Student’s t-distribution as long as a simple random sample was taken, the population standard deviation is approximated with the sample standard deviation, and the the population is approximately normally distributed.

For hypothesis tests involving: [latex]H_o: \mu = \mu_o[/latex],   [latex]H_o: \mu \leq \mu_o[/latex],  or   [latex]H_o: \mu \geq \mu_o[/latex],

We assume [latex]H_o[/latex] is true, so the null distribution is [latex]\bar{X} \sim t_{n-1}(\mu_o, \frac{s}{\sqrt{n}})[/latex].

The test statistic (t-score) is [latex]\displaystyle{t = \frac{\bar{x} - \mu_o}{\frac{s}{\sqrt{n}}}}[/latex].

Probability associated with the test statistic can be found from the Student’s t-distribution with [latex]n - 1[/latex] degrees of freedom. Equivalently, the p-value can be found using the null distribution directly.

If [latex]H_a: \mu \neq \mu_o[/latex], calculate the p-value as the sum of the areas in the tails cut off by [latex]-t[/latex] and [latex]t[/latex].

If [latex]H_a: \mu \gt \mu_o[/latex], calculate the p-value as the area to the right of the test statistic, [latex]t[/latex].

If [latex]H_a: \mu \lt \mu_o[/latex], calculate the p-value as the area to the left of the test statistic, [latex]t[/latex].

Steps to Conducting a Hypothesis Test for a Single Mean:

  1. After considering the research question, define the null and alternate hypothesis statements.
  2. Assume the null hypothesis is true and define the null distribution, stating how assumptions have been met.
  3. Under the assumptions that the null hypothesis is true, calculate the test statistic.
  4. Compute the p-value and create a drawing to support the calculation.
  5. Form a conclusion and write it in the context of the research question.

Example 1 – Monarch Butterflies

Some people believe that the earth’s magnetic field guides some animals as they travel over great distances. However, it is not clear how these animals detect the earth’s magnetic field. The monarch butterfly is an example of an animal that may travel this way. Monarch butterflies cannot survive a long cold winter, so they migrate long distances south in the fall. Monarch butterflies fly to the same winter roosts year after year. Often they fly to the same trees each winter. It is not known how the monarch butterflies locate their winter homes. One possibility is that they have some magnetic material in their bodies that allows them to sense a magnetic field.

Biologists wanted to determine whether monarch butterflies have some magnetic material in their bodies. They used a tool called a magnetometer for this test. The magnetometer measures magnetic units called nano-emus. Unfortunately, the magnetometer itself creates some magnetism. The magnetometer creates about 20 nano-emus of magnetism. (A nano-emu is 10−9 magnetic units.) In order to demonstrate that monarch butterflies have some magnetic material in their bodies, the biologists needed to be able to show that the monarch butterflies’ mean magnetism is greater than 20 nano-emus.

A random sample of 16 monarch butterflies were examined. The measured magnetic intensity (in nano-emus) of each butterfly is given in Table 1:

Table 1: Magnetic Strength of Monarch Butterflies (in nano-emus)
48.6 32.8 53.2 32.3 17.3 12.2 36.6 29.8
12.4 21.9 26.4 49.0 14.5 7.5 40.2 29.0

Do the data provide evidence to conclude that at the 5% significance level, the mean magnetic intensity for monarch butterflies is greater than 20 nano-emus? Conduct a hypothesis test using the five steps.

Solution:

  1. The research question involves the mean magnetic intensity, so this is a test of means. The alternate hypothesis will state that the mean magnetic intensity greater than 20 nano-emus. The opposite of this claim will be the null hypothesis, that is, the mean magnetic intensity is less than or equal to 20 nano-emus.
    [latex]H_o[/latex]: [latex]\mu \leq 20[/latex]
    [latex]H_a[/latex]: [latex]\mu \gt 20[/latex]
  2. The study involved a small random sample of 16 butterflies, with [latex]\bar{x}[/latex] = 28.98 nano-emus and [latex]s[/latex] = 14.150 nano-emus. Note that in this case, we do not have information about the population standard deviation, so we will have to estimate it. As long as the population from which the sample came is approximately normal, the sample mean will be distributed as a t-distribution with 15 degrees of freedom. A normal probability plot will give insight into the distribution of the population.
    A normal probability plot of the butterfly data showing the data follows a line reasonably well.
    Figure 1: A Normal Probability Plot of Magnetic Intensity

    The sample data appear to fall along a line, so the assumption that the population is normally distributed is met.

    Because we begin the hypothesis test by assuming the null hypothesis is true, we assume the sample is drawn from a population with a mean of [latex]\mu_o =[/latex] 20 nano-emus and standard deviation of [latex]s =[/latex] 14.150 nano-emus.  Under these conditions the sample mean is distributed as [latex]\bar{X} \sim t_{15}(20, \frac{14.150}{\sqrt{16}})[/latex], and the t-test statistic will be used.

  3. The test statistic is [latex]\displaystyle{t = \frac{\bar{x} - \mu_o}{\frac{s}{\sqrt{n}}}} = \frac{28.98 - 20}{\frac{14.150}{\sqrt{16}}} = 2.5389[/latex].
  4. The p-value is the probability of observing a sample mean as extreme as we did under the assumption that the null hypothesis is true. With a statistical program it is simple to conduct a hypothesis test using the value of the t-test statistic or, equivalently, with the null sampling distribution directly. Both options are presented in Figure 2:
    Distribution of the sample mean or the test statistic with the p-value probability shaded.
    Figure 2: P-Value Shaded

    The p-value is the probability of observing a t-test statistic of t = 2.5389 or more extreme. Because this is a one-tailed (right-tailed) test, the p-value will be calculated by finding the probability as [latex]P(t \geq 2.5389) \approx[/latex] 0.011346 or approximately 1.1%.
    Alternatively, and equivalently, the probability under the null hypothesis of observing a sample mean of [latex]\bar{x}[/latex] = 28.98 nano-emus or more extreme can be calculated directly as [latex]P(\bar{x} \geq 28.98)[/latex] using the null distribution, giving the same p-value.

  5. Assuming the null hypothesis is true, the probability we would observe a sample mean as extreme as the one we observed is 0.0113. There is a 1.1% chance of observing a sample as least as extreme as we did, which a small probability and less than a 5% level of significance. Because this is highly unlikely, we conclude that we have evidence to reject the null hypothesis. The data supports the claim that the mean magnetic intensity of monarch butterflies exceeds 20 nano-emus. This means that monarch butterflies contain a natural magnetic intensity.

Example 2 – Lifespan of Batteries

Imagine that a company sells portable walkie-talkie radios to construction crews. The batteries for these radios last for an average of 55 hours. The purchasing manager for this company receives a brochure in the mail that advertises a new brand of batteries. This new brand of batteries is cheaper than the brand that the company currently uses. However, the purchasing manager is concerned that the cheaper batteries may have a shorter average battery life than the current brand. Note: The number of hours that batteries last is called their battery life. The pricing manager installs 40 randomly selected batteries of the cheaper brand in the company’s walkie-talkie radios. The manager finds that the mean battery life for the sample is 52 hours, with a standard deviation of 10 hours.  Perform a statistical test at the 1% level of significance to determine whether the cheaper batteries have a shorter average battery life span than the average life span of the brand of batteries the company currently uses. Assume that the requirement of normality has been met.

Solution:

  1. The research question involves the mean battery lifetime, so this is a test of means. The alternate hypothesis will state that the mean lifetime is less than 55 hours. The opposite of this claim will be the null hypothesis, that is, the mean lifetime is greater than or equal to 55 hours.
    [latex]H_o[/latex]: [latex]\mu \geq 55[/latex]
    [latex]H_a[/latex]: [latex]\mu \lt 55[/latex]
  2. The study involved a random sample of 40 batteries, with [latex]\bar{x}[/latex] = 52 hours and [latex]s[/latex] = 10 hours. We do not have information about the population standard deviation, so we will have to estimate it. As long as the population from which the sample came is approximately normal, the sample mean will be distributed as a t-distribution with 39 degrees of freedom. We are to assume that the population is normally distributed.Because we begin the hypothesis test by assuming the null hypothesis is true, we assume the sample is drawn from a normal population with a mean of [latex]\mu_o =[/latex] 55 hours and standard deviation of [latex]s =[/latex] 10 hours.  Under these conditions the sample mean is distributed as [latex]\bar{X} \sim t_{39}(55, \frac{10}{\sqrt{39}})[/latex], and the t-test statistic will be used.
  3. The test statistic is [latex]\displaystyle{t = \frac{\bar{x} - \mu_o}{\frac{s}{\sqrt{n}}}} = \frac{52 - 55}{\frac{10}{\sqrt{39}}} = -1.873[/latex].
  4. The p-value is the probability of observing a sample mean as extreme as we did under the assumption that the null hypothesis is true. With a statistical program it is simple to conduct a hypothesis test using the value of the t-test statistic or, equivalently, with the null sampling distribution directly. Both options are presented in Figure 3:
    Two graphs showing the t-distribution p-value calculations using the sampling distribution of the mean or the distribution of the test statistic. Both show a p-value of 0.0326.
    Figure 3: P-Value Shaded

    The p-value is the probability of observing a t-test statistic of t = -1.873 or more extreme. Because this is a one-tailed (left-tailed) test, the p-value will be calculated by finding the probability as [latex]P(t \leq -1.873) \approx[/latex] 0.0326 or approximately 3.3%.
    Alternatively, and equivalently, the probability under the null hypothesis of observing a sample mean of [latex]\bar{x}[/latex] = 52 hours or more extreme can be calculated directly as [latex]P(\bar{x} \leq 52)[/latex] using the null distribution, giving the same p-value.

  5. Assuming the null hypothesis is true, the probability we would observe a sample mean as extreme as the one we observed is 0.0326. There is a 3.3% chance of observing a sample as least as extreme as we did, which a small probability but not less than the 1% level of significance. Because the p-value is larger than the 1% level of significance, we conclude that we do not have enough evidence to reject the null hypothesis. The data do not support the claim that the mean lifetime of batteries is less than 55 hours. The observed sample mean is not statistically significant.

Sources

Statway College Module 4, by Carnegie Math Pathways, is licensed under CC BY NC 4.0.

Douglas Jones and Bruce MacFadden, “Induced Magnetization in the Monarch Butterfly, Danaus Plexippus (Insecta, Lepidoptera)” Journal of Experimental Biology 96 (1982): 1-9.

License

Icon for the Creative Commons Attribution 4.0 International License

Introduction to Statistics for Engineers Copyright © by Vikki Maurer & Jeff Crabill & Linn-Benton Community College is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.