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 = [ (x_{1} – x_{2}) – d ] / (√s^{2}_{1} / n_{1} + s^{2}_{2} / n_{2})

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 ] / (√2^{2} / 100 + 3^{2}/ 100) = 2 / (.36) = **5.555**

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

(s_{1}^{2}/n_{1} + s_{2}^{2}/n_{2})^{2} / { [ (s_{1}^{2} / n_{1})^{2} / (n_{1} – 1) ] + [ (s_{2}^{2} / n_{2})^{2} / (n_{2} – 1) ] }

(2^{2}/100 + 3^{2}/100)^{2} / { [ (2^{2} / 100)^{2} / (100 – 1) ] + [ (3^{2} / 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 = [ (x_{1} – x_{2}) – d ] / (√s^{2}_{1} / n_{1} + s^{2}_{2} / n_{2})

test statistic t = [ (120 – 115) – 10 ] / (√12^{2} / 80 + 15^{2}/ 80) = -5 / (2.148) = –**2.328**

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

(s_{1}^{2}/n_{1} + s_{2}^{2}/n_{2})^{2} / { [ (s_{1}^{2} / n_{1})^{2} / (n_{1} – 1) ] + [ (s_{2}^{2} / n_{2})^{2} / (n_{2} – 1) ] }

(12^{2}/80 + 15^{2}/80)^{2} / { [ (12^{2} / 80)^{2} / (80 – 1) ] + [ (15^{2} / 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.