Surviving Statistics

Chapter 11: Two-Sample Hypothesis Testing

Learn how to test differences between two means or proportions using independent and dependent samples.

Start here

Overview

Extend the five-step hypothesis-testing process to comparisons between two groups, including independent means, proportions, and matched or dependent samples.

What You Will Learn

  • State null and alternative hypotheses for two-population comparisons.
  • Conduct a two-sample z test when population standard deviations are known.
  • Conduct an independent-samples t test when standard deviations are unknown.
  • Test a difference between two population proportions.
  • Recognize and analyze dependent or paired samples.
  • Interpret test statistics, p-values, and decisions in context.

Before You Begin

  • One-sample hypothesis testing from Chapter 10.
  • Confidence intervals, standard error, and critical values.
  • Sample means, proportions, variance, and standard deviation.

Why This Matters

Organizations frequently compare groups, treatments, shifts, locations, or before-and-after measurements. Two-sample methods help determine whether observed differences are larger than ordinary sampling variation.

Plan Your Study

  • Read the written chapter and identify its main terms and procedures.
  • Watch the instructional videos and compare the worked examples.
  • Use the two-sample hypothesis test calculator to verify your calculations.
  • Complete the guided questions before attempting the challenge activities.
  • Review the study sheet and explain each conclusion in context.

Next step

Read the complete chapter.

The Learn tab contains the written lesson from Surviving Statistics.

Go to Learn

Written lesson

Learn Chapter 11: Two-Sample Hypothesis Testing

Learn how to test differences between two means or proportions using independent and dependent samples.

Advertisement

Two sample hypothesis testing

This chapter in Surviving Statistics explains how to complete a Hypothesis testing with two samples.

Chapter Study Sheet

⬇
Printable Study Sheet Open or download

Instructional Videos

▶
Surviving Statistics: Two Sample test of Hypothesis Watch video
▶
Business Statistics: Two Sample test of Hypothesis Watch video
▶
Two Sample T test in Excel Watch video

Surviving Statistics Chapter 11 - File Downloads

⬇
Day and Night Nurse Satisfaction Open or download

⬇
Nurses before and after training Open or download

Two sample hypothesis testing

In the previous chapter, we explored hypothesis testing comparing one sample’s mean or proportion to a population mean or proportion. In this chapter, we will discuss the computations needed in hypothesis testing to compare two samples.

Two Sample Hypothesis Testing – Known Population Standard Deviation

We will compare two sample means, each representing a different population. We will, however, need the standard deviation for each population. To help understand this procedure, here is an example.

Keisha, a new administrator for Quad-States Hospital, is interested in the satisfaction ratings for day and evening shift nurses. Patients are asked to rate their nurses on several items on a scale of 1 to 5. As she began her research, she was told that both shifts have equal patient satisfaction ratings and both shifts have a standard deviation of .2.

From listening to a few patients since arriving here, Keisha believes the night shift may be doing a better job caring for patients. She sets out to test this hypothesis.

Step 1: State the null and alternate hypothesis:

H0 Night shift satisfaction ratings <= day shift ratings H1 Night shift satisfaction ratings > day shift ratings

Step 2: Select the level of significance:

Keisha selects a .02 level of significance. This gives her a 2% chance of making a Type I error.

Step 3: Determine the test statistic:

Because Keisha has the historic population standard deviation, she will use the z distribution.

Step 4: Determine the critical value (decision rule):

This is a one-tail test because Keisha is only checking one direction. The z score that equates to an area of .48 (2% in the single tail) and using the table in Figure 35, this is close to 2.055.

Statistics lesson screenshot 11thChapter1

Step 5: Take a sample, compute the test statistic and make a decision

Keisha randomly surveyed 25 patients and asked them to rate their day shift nurse. She then surveyed another 30 patients and asked them to rate their night shift nurses. The mean for the day shift nurses was 4.55 and the night shift nurses was 4.7.

The formula to compute a z score from two samples is:

Statistics lesson screenshot 11thChapter2

Keisha’s computed a z score is larger than the critical value. She will reject the null hypothesis and conclude, at least for this sample, night shift nurses have higher ratings than day shift nurses.

Two Sample– Unknown Standard Deviation

Many times, as we have already discussed, when you are doing your own research you will not have the population standard deviation available. In these cases, you will likely use the t distribution.

To illustrate a two-sample hypothesis test using the t distribution we will revisit Keisha and her hypothesis on nursing ratings. This time though she either does not have the population standard deviation or does not trust the one she was provided.

Step 1: State the null and alternate hypothesis:

H0 Night shift satisfaction ratings <= day shift ratings H1 Night shift satisfaction ratings > day shift ratings

Step 2: Select the level of significance:

Keisha selects a .05 level of significance. This gives her a 5% chance of making a Type I error.

Step 3: Determine the test statistic:

Because Keisha does not have the population standard deviation, she will use the t statistic.

Step 4: Determine the critical value (decision rule):

This is a one-tail test because Keisha is only checking one direction. The t distribution requires Keisha to use degrees for freedom as well as the level of significance to locate the critical value. With two samples, the degrees of freedom are: n1 + n2 – 2, or 53 in this case.

Using a table or Excel, Keisha locates a critical t value of 1.674.

Statistics lesson screenshot 11thChapter3

If you examine the Excel formula closely you will notice the (-) at the beginning. Because this function returns the left tail value, which is negative, placing the minus sign at the beginning causes the t critical value to be positive.

Step 5: Take a sample, compute the test statistic and make a decision

Keisha took two samples, 25 day patients and 30 evening patients. The results with the mean and sample standard deviation are as follows:

Computing a t score from two samples is somewhat complex if you do it manually. Excel has an excellent tool that we will discuss later. For now though, we will go over the manual method.

Statistics lesson screenshot 11thChapter4

The first step in computing a two-sample t test score is to compute the pooled variance. The formula for doing this is:

Statistics lesson screenshot 11thChapter5

After computing the pooled variance, you use it in the formula to compute a t score, which is:

Statistics lesson screenshot 11thChapter6

So, for Keisha, the pooled variance becomes:

Statistics lesson screenshot 11thChapter7

The pooled variance = .19478

Notice that we are using the night shift, the sample with the highest mean as sample 1.

Now that we have the pooled variance, we can compute the t statistic as follows:

Statistics lesson screenshot 11thChapter8

In this case, the computed t score is less than the critical value, so Keisha will not reject the null hypothesis. She cannot conclude that night nurses receive higher satisfaction scores than day shift nurses do.

When Keisha conducted the first hypothesis test using the z statistic, she was able to reject the null hypothesis. However, using the t test she is not able to do so. This is because the standard deviation she computed with her sample is much larger than the assumed population standard deviation (.02) she used with the z test.

Try it in Excel:

Excel’s data analysis add-in has a t test option that computes the t statistic after selecting the data from both samples. From the data analysis tools, choose t –Test Two sample assuming equal variances.

Note: Even though the variances of the day and night shift samples appear to differ in this example, they are not unequal from a statistical standpoint. In the next chapter, you will learn to conduct a hypothesis test to examine the equality of variance.

Statistics lesson screenshot 11thChapter9

Next, select the two ranges containing the data from each sample. Select the desired alpha level, the level of significance, and click OK.

Statistics lesson screenshot 11thChapter10

The result will display t statistics for both one and two tail tests. Excel also displays the critical values for each test in the output.

Statistics lesson screenshot 11thChapter11

Two Sample Hypothesis Test – Proportions

Keisha is continuing her efforts to analyze and improve patient satisfaction. While patients interact with several nurses, Keisha realizes they seem to remember the nurse who discharged them, their last contact with the hospital, more than all the others. Keisha attempts to see if there is a difference in the overall patient satisfaction ratings between patients discharged by day shift nurses and those discharged by night shift nurses. Over the next week, Keisha randomly called several discharged patients and asked them if they were satisfied with the services offered at the hospital, allowing only “yes” or “no” as valid answers. Keisha uses patient records to see if they were discharged by day or night shift nurses.

Step 1: State the null and alternate hypothesis:

H0 Day shift nurse patient satisfaction = Night shift nurse patient satisfaction H1 Day shift nurse patient satisfaction <> Night shift nurse patient satisfaction

Step 2: Select the level of significance:

Keisha selects a .05 level of significance. This gives her a 5% chance of making a type I error.

Step 3: Determine the test statistic:

Because Keisha is working with proportions, she will use the z distribution.

Step 4: Determine the critical value (decision rule):

This is a two-tail test because Keisha is checking both directions, “different than”. With a .05 level of significance, each tail will have an area of 0.025. Finding the area of 0.475 in the normal distribution table, Keisha determines the critical value is 1.96.

Keisha surveys 55 discharged patients and finds that 25 were discharged by day shift nurses and 30 by night shift nurses. The results were as follows: Day shift discharge patients satisfied: 20/25 Night shift discharge patients satisfied: 25/30

The formula for computing a z score comparing two proportions has two steps.

The first step is to compute the pooled proportion.

The formula to do this is:

Statistics lesson screenshot 11thChapter12

After computing the pooled proportion, you can then compute the z score with this formula:

Statistics lesson screenshot 11thChapter13

The computed Z score is =.31884, falls within the “Do not reject” area because it is not greater than 1.96 or less than -1.96. Keisha will not reject the null hypothesis and conclude, based on this limited survey, the satisfaction ratings between patients discharged by day and evening nurses are equal.

Two Sample Hypothesis Test – Dependent Samples

The samples discussed and used in the examples so far are independent samples. That is, the patients surveyed about day nurses were not the same patients surveyed about night nurses. Other than being in the same hospital, there is no direct relationship between the two samples.

Conversely, a dependent sample is the same sample surveyed twice. The second survey is usually after an intervention such as a training, an adjustment, or a medication. The hypothesis revolves around the intervention and tests if the intervention resulted in a change, positive or negative. The same individuals are surveyed before and after the intervention.

To illustrate a hypothesis test using dependent samples, assume Keisha decides to see if a training program can improve individual nurses’ patient satisfaction ratings. She decides to measure their mean ratings before and after the training. Keisha randomly selects ten nurses and records their patient satisfaction ratings for one week. After they attend customer service training, she records the same nurses’ ratings for the week after they complete training. Keisha is hopeful the training will improve patient satisfaction and sets out to test her hypothesis.

Step 1: State the null and alternate hypothesis:

H0 Ratings after training <= Ratings before training H1 Ratings after training > Ratings before training

Step 2: Select the level of significance:

Keisha selects a .05 level of significance. This gives her a 5% chance of making a Type I error.

Step 3: Determine the test statistic:

We will assume Keisha does not have the population standard deviation and therefore, she uses the t distribution.

Step 4: Determine the critical value (decision rule):

This is a one-tail test because Keisha is checking only one direction, “greater than”. The sample size is 10, even though the nurses were sampled twice. That means the degrees of freedom are 9. The critical value from the t distribution table in Figure 36 is 1.833.

Statistics lesson screenshot 11thChapter14

Step 5: Take a sample, compute the test statistic and make a decision

Keisha gathers the ratings for the ten nurses before and after the training as shown below:

Statistics lesson screenshot 11thChapter15

The formula to compute a t statistic from dependent (paired) samples is:

Statistics lesson screenshot 11thChapter16

In this formula sd is the standard deviation of the differences between the before and after values. It is computed as:

Statistics lesson screenshot 11thChapter17

Note that we compute the difference by subtracting the mean rating before then training from the mean after the training.

After computing the standard deviation of the differences, the t statistic is computed as:

Statistics lesson screenshot 11thChapter18

The computed t stat is larger than the critical value of 1.833, so Keisha rejects the null hypothesis and concludes the training resulted in higher ratings for the nurses.

Try it in Excel:

Excel’s data analysis add-in has a paired t test option that computes a t statistic for dependent samples.

Statistics lesson screenshot 11thChapter19

To avoid computing a negative t statistic, the “after training” sample is Variable range 1.

Statistics lesson screenshot 11thChapter20

As with the other t test options in Excel’s data analysis feature, the output table displays critical values for both one and two tail test as well as p values.

The p value for this one tail test is .03113. Keisha set up to test the hypothesis with a .05 level of significance. Keisha can also use the p value to determine whether or not to reject the null hypothesis. If the computed p value is smaller than the level of significance Keisha selected, she can reject the null hypothesis. If the p value is larger, she will not reject the null hypothesis.

Advertisement

Next step

See the concepts demonstrated.

Continue to Watch for chapter videos and worked examples.

Go to Watch

See it explained

Watch

Choose the explanation or example that best supports your learning.

Next step

Apply what you have learned.

Use the guided questions and interactive calculator activities in Practice.

Go to Practice

Apply what you learned

Practice Chapter 11: Two-Sample Hypothesis Testing

Apply the chapter procedures, interpret each result in context, and use the companion calculator to verify your work after attempting each problem.

Launch Interactive Calculator

Guided Practice

  • Write hypotheses for testing whether two population means differ.
  • Explain when two samples are independent.
  • Describe how paired data differ from independent samples.
  • Use the nurse-satisfaction data to identify the appropriate two-sample procedure.
  • Interpret a p-value for a difference between two proportions.

Challenge Yourself

  • Create one independent-samples and one dependent-samples business example.
  • Explain how reversing Sample 1 and Sample 2 changes the sign but not the two-tailed conclusion.
  • Compare pooled and unpooled approaches conceptually.

Check Your Understanding

  • Why must the sampling design be identified before choosing a test?
  • What does the null hypothesis usually claim about the difference?
  • When is a paired t test appropriate?
  • Why is statistical significance not the same as practical importance?

Next step

Save the materials you may need later.

Open Resources for the study sheet, spreadsheets, and related learning materials.

Go to Resources

Keep learning

Resources

Study sheets, downloadable files, companion tools, and related lessons for this chapter.

For educators

Teaching this chapter?

The Instructor tab contains objectives, teaching ideas, assessments, and a printable guide.

Open Instructor Resources

LutherMaddy.com — Helping Humans Learn

Chapter 11: Two-Sample Hypothesis Testing: Instructor Resources

Teach this lesson

Instructor Resources

Classroom-ready objectives, teaching ideas, questions, and assessment materials for this chapter.

Calculator Instructor Resources

Learning Objectives

  • State null and alternative hypotheses for two-population comparisons.
  • Conduct a two-sample z test when population standard deviations are known.
  • Conduct an independent-samples t test when standard deviations are unknown.
  • Test a difference between two population proportions.
  • Recognize and analyze dependent or paired samples.
  • Interpret test statistics, p-values, and decisions in context.

Prerequisite Knowledge

  • One-sample hypothesis testing from Chapter 10.
  • Confidence intervals, standard error, and critical values.
  • Sample means, proportions, variance, and standard deviation.

Teaching Outline

  • Introduce the purpose and vocabulary of Two-Sample Hypothesis Testing.
  • Connect the chapter procedure to prior concepts.
  • Work one numerical example in clearly labeled steps.
  • Demonstrate the two-sample hypothesis test calculator and compare its output with the manual work.
  • Emphasize interpretation, assumptions, and limitations.
  • Conclude with guided practice and a contextual decision.

Key Concepts

  • State null and alternative hypotheses for two-population comparisons.
  • Conduct a two-sample z test when population standard deviations are known.
  • Conduct an independent-samples t test when standard deviations are unknown.
  • Test a difference between two population proportions.
  • Recognize and analyze dependent or paired samples.

Classroom Demonstration

  • Use a small, transparent data set to demonstrate the chapter procedure.
  • Repeat the example with the two-sample hypothesis test calculator and reconcile every reported value.
  • Change one input and ask students to predict how the result or conclusion will change.

Questions to Ask

  • Why must the sampling design be identified before choosing a test?
  • What does the null hypothesis usually claim about the difference?
  • When is a paired t test appropriate?
  • Why is statistical significance not the same as practical importance?

Teaching Notes

  • Require students to state the question and define symbols before substituting numbers.
  • Separate arithmetic accuracy from interpretation when providing feedback.
  • Ask students to check assumptions before selecting a method.
  • Use the companion spreadsheet or calculator as verification rather than as a substitute for reasoning.

Assessment Ideas

  • Assign one procedural computation and one interpretation question.
  • Use a short scenario in which students must select the appropriate method.
  • Ask students to diagnose an intentionally incorrect conclusion.
  • Have students submit calculator output together with a written explanation.

Grading Rubric

CriterionPoints
Selects the appropriate method2
Defines variables, hypotheses, or parameters correctly2
Completes the computation accurately3
Checks assumptions and decision criteria1
Interprets the result in context2
Total10

Exam and Discussion Questions

Basic

  • Define two important terms from Two-Sample Hypothesis Testing.
  • State the principal conditions or assumptions for the procedure.

Applied

  • Write hypotheses for testing whether two population means differ.
  • Interpret a p-value for a difference between two proportions.

Conceptual

  • Why must the sampling design be identified before choosing a test?
  • Why is statistical significance not the same as practical importance?

Keep Exploring

Continue Learning

Explore step-by-step lessons, interactive calculators, downloadable study sheets, and practical educational resources.