Hypothesis Testing for a Difference in Means


This lesson explains how to conduct a hypothesis test for a difference between two population means. This type of test is known as a two-sample independent t-test.

Checking Conditions

Before we can conduct a hypothesis test for a difference between two population means, we first need to make sure the following conditions are met to ensure that our hypothesis test will be valid:

  • Random: A random sample or random experiment should be used to collect data for both samples.
  • Normal: The sampling distribution is normal or approximately normal.
  • Independence: The two samples are independent. 

If these conditions are met, we can then conduct the hypothesis test. The following two examples show how to conduct a hypothesis test for a difference between two population means.

Hypothesis Test for a Difference in Means (Two-Tailed)

Researchers want to know whether diet A or diet B helps people lose more weight. 100 randomly assigned people are assigned to diet A. Another 100 randomly assigned people are assigned to diet B. After three months, the mean weight loss for those on diet A was 8 pounds with a standard deviation of 2 pounds and the mean weight loss for those on diet B was 6 pounds with a standard deviation of 3 pounds.

Test the hypothesis that the two diets are equally effective in helping people lose weight. Use a .05 level of significance. 

Step 1. State the hypotheses. 

The null hypothesis (H0): μA = μB

The alternative hypothesis: (Ha): μA ≠ μB

Step 2. Determine a significance level to use.

The problem tells us that we are to use a .05 level of significance. 

Step 3. Find the test statistic.

test statistic t  = [ (x1 – x2) – d ]  /  (√s21 / n1 + s22 / n2)

where d is the hypothesized difference. (In this case, d = 0, since we hypothesize that the two means are equal, i.e. the difference between the two means is zero.)

test statistic t  = [ (8 – 6) – 0 ]  /  (√22 / 100 + 32/ 100) = 2 / (.36) = 5.555

To find the degrees of freedom, use the following formula:

 (s12/n1 + s22/n2)2 / { [ (s12 / n1)2 / (n1 – 1) ] + [ (s22 / n2)2 / (n2 – 1) ] }

(22/100 + 32/100)2 / { [ (22 / 100)2 / (100 – 1) ] + [ (32 / 100)2 / (100 – 1) ] }

(0.0169) / {(.0016/99) + (.0081/99)} = 172.48. Round to the nearest whole number: 172.

Use the T Score to P Value Calculator with a t score of 5.555, degrees of freedom of 172, and a two-tailed test, to find that the p-value = 0.000.

4. Reject or fail to reject the null hypothesis.

Since the p-value is less than our significance level of .05, we reject the null hypothesis.

5. Interpret the results. 

Since we rejected the null hypothesis, we have sufficient evidence to say that the two diets are not equally effective in helping people lose weight.

Hypothesis Test for a Difference in Means (One-Tailed)

A company invents a new battery for phones. The company claims that this new battery will work for at least 10 minutes longer than the old battery. To test this claim, a researcher takes a simple random sample of 80 new batteries and 80 old batteries. The new batteries run for an average of 120 minutes with a standard deviation of 12 minutes and the old batteries run for an average of 115 minutes with a standard deviation of 15 minutes.

Test the company’s claim that the new batteries run for at least 10 minutes longer than the old batteries. Use a .05 level of significance. 

Step 1. State the hypotheses. 

The null hypothesis (H0): μ1 – μ2 ≥ 10

The alternative hypothesis: (Ha): μ1 – μ2 < 10

Step 2. Determine a significance level to use.

The problem tells us that we are to use a .05 level of significance. 

Step 3. Find the test statistic.

test statistic t  = [ (x1 – x2) – d ]  /  (√s21 / n1 + s22 / n2)

test statistic t  = [ (120 – 115) – 10 ]  /  (√122 / 80 + 152/ 80) = -5 / (2.148) = –2.328

To find the degrees of freedom, use the following formula:

 (s12/n1 + s22/n2)2 / { [ (s12 / n1)2 / (n1 – 1) ] + [ (s22 / n2)2 / (n2 – 1) ] }

(122/80 + 152/80)2 / { [ (122 / 80)2 / (80 – 1) ] + [ (152 / 80)2 / (80 – 1) ] }

(21.279) / {(.041) + (.100)} = 150.91. Round to the nearest whole number: 151.

Use the T Score to P Value Calculator with a t score of -2.328, degrees of freedom of 151, and a one-tailed test, to find that the p-value = 0.011.

4. Reject or fail to reject the null hypothesis.

Since the p-value is less than our significance level of .05, we reject the null hypothesis.

5. Interpret the results. 

Since we rejected the null hypothesis, we have sufficient evidence to say that the new batteries do not run for at least 10 minutes longer than the old batteries.

Leave a Reply

Your email address will not be published. Required fields are marked *