Hypothesis Testing for Differences Between Two Proportions

UPI Study › Courses › Marketing Research › Free lessons › Lesson 11.8 Free lesson

Hypothesis Testing for Differences Between Two Proportions

Marketing Research · Chapter 11: Hypothesis Testing and Inferential StatisticsSection 11.8 · lesson 82 of 10111 min · free to watch

← Hypothesis Testing for ProportionsNext lesson: Hypothesis Testing for Matched Pairs and Dependent Samples →

Earn 3 college credits for Marketing ResearchRecommended for credit by NCCRS · Marketing 300 · self-paced · one payment, lifetime access

In this lesson

Test whether two groups' rates differ using a pooled proportion.

  • Compute a pooled proportion and the two-proportion z statistic
  • Build a confidence interval for the difference between two rates
  • Check the success and failure counts needed for the test
  • Connect the two-proportion z test to the 2x2 chi-square test

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,530 words). Read along, or search it.

Opening Question

Online Wins by Almost Eleven Points

Fernway Snacks, a composite case built for teaching, sends two groups of shoppers a coupon for the new bar. One group is 180 online shoppers. The other is 200 grocery shoppers.

Afterward, Leo reports the results. 36.7 percent of the online group redeemed the coupon. In grocery, it was 26.0 percent. "Online wins, by almost eleven points!"

The brand manager looks puzzled. If the coupon worked the same in both places, how often would two groups of this size still end up that far apart? Just from who happened to be in each group? That is exactly the question a two-proportion test answers. Leo sees a winner. Nadia sees a question. And both of them are looking at the same two numbers. The test settles who has the better reading.

Learning Goals

Pooled Rate, Z and the Chi-Square Link

By the end of this lesson, you will test whether two proportions differ, using a pooled proportion and a z statistic. You will compute each step: the pooled proportion, the standard error, z, and the p-value. And you will connect this test to the chi-square test of a two by two table, from lesson 11.1.

Two Rates

A Shared Line at 31.1 Percent

First: two rates, one question. Picture two bars. The online bar is taller. It shows 66 redeemers, out of 180. The grocery bar shows 52, out of 200.

Across both bars runs a red dashed line, at 31.1 percent. That is the single pooled rate that both groups would share, if the null hypothesis were true. Keep that line in mind. It is the heart of this test. Every step that follows asks one thing. How far does each bar sit from that shared line? And is that distance bigger than luck would usually produce?

The hypotheses, in words. The null: the true redemption rate is the same online and in grocery. The alternative: the two true rates differ. In symbols, the null says p one equals p two. The alternative says p one is not equal to p two. That makes it two-tailed. Alpha is 0.05.

Formula

Standard Error From the Pooled Rate

Now the formula, in words. z is the difference between the two sample proportions, divided by the standard error of that difference. And the standard error uses the pooled proportion: all successes, divided by all shoppers.

Let us name every part. P one hat is x one over n one: the online redeemers, over the online shoppers. P two hat is x two over n two, for grocery. The first count and the second count show the redeemers. N one and n two are the group sizes. And p bar is the pooled proportion.

The standard error is the square root of three things multiplied together. P bar. One minus p bar. And one over n one, plus one over n two.

Why Pool

One Shared Rate Under H0

So why pool? A hypothesis test works as if the null hypothesis were true. And the null says both groups share one true rate. If they share one rate, then the best single estimate of that rate uses everyone. So we merge both groups into one rate. That rate builds the standard error.

This is the same logic you met in lesson 11.7. There, the test used the claimed proportion, p zero, inside the standard error. Here, there is no claimed number. The null only says the two rates are equal. So the pooled rate plays the role of the claim. In both lessons, the rule is the same. Build the standard error in the world where the null hypothesis is true. Then see how surprising the data look from there.

Now, by hand. P one hat is 66 over 180. That is 0.3667. P two hat is 52 over 200. That is 0.2600. The gap is 0.1067.

The pooled proportion is 66 plus 52, over 180 plus 200. That is 118 over 380, or 0.3105.

Worked Example

Gap of Two and a Quarter Standard Errors

The standard error is the square root of 0.3105, times 0.6895, times one over 180, plus one over 200. That works out to 0.0475.

Then z is 0.1067, over 0.0475. That gives 2.244. In plain words, the gap between the two channels is about two and a quarter standard errors wide. That is a long way from zero. Luck alone rarely stretches a gap that far.

For a two-tailed test at 0.05, the cutoffs are plus and minus 1.96. Our z, at 2.24, lies beyond 1.96. Chance alone produces a gap this large, in either direction, in about 2.5 percent of tests.

The decision. The p-value is 0.0248. That is below 0.05. So we reject the null hypothesis. The coupon probably does not work the same in both places. The gap is too large to blame on who happened to land in each group.

Interval

Low End of 1.4 Points Keeps It Honest

For Fernway, the redemption rates are probably not equal. And online appears higher. But look at the interval for the gap, too. It runs from 0.014 to 0.200. That is about 1.4 percentage points at the low end, and 20 at the high end.

That interval stays above zero, which matches the test. But its low end is small. So the true online advantage might be modest. A gap at the interval's low end would be real, but it would hardly justify a big shift in spending. The interval keeps Leo honest about the size of the win.

Conditions

Ten Successes and Ten Failures Each

Next: checks and connections. First, the conditions. The groups should be independent random samples. And each group should have at least about 10 successes, and 10 failures.

Check Fernway's numbers. Online: 66 successes, and 114 failures. Grocery: 52 successes, and 148 failures. All four counts are far above 10. So the bell-curve approximation is safe here.

When a group has very few successes, or very few failures, the bell curve becomes a poor guide. Picture a group where only six shoppers out of a hundred redeemed. The count of six is too small to trust the normal approximation. In that case, flag the problem before trusting the z test. Software will still print a z and a p-value. It does not check the condition for you. That part is your job, and it takes only a moment.

Chi-Square Link

Chi-Square Equals Z Squared

Now, a link to lesson 11.1. Put the same data in a two by two table. One way: the channel, online or grocery. The other way: redeemed, or not. Then run chi-square, without any correction.

What do you get? The chi-square statistic is 5.035. That is exactly z squared: 2.244 squared. And the p-value is the same.

So the two-proportion z test is the two by two chi-square test, seen from another angle. They are not rival methods. They are the same evidence, in two different costumes. That also means you can pick whichever is easier for your software, and get the same decision.

Back at the office, Leo wants to double the online coupon budget. Grace slows him down. "Online redemption is probably higher. But shoppers chose their channel. So the channel may not have caused the gap."

Cause

Randomize the Coupon Next Quarter

What could explain it instead? Online shoppers might be younger. They might already like snack bars more. Or they might simply be more used to digital coupons. Any of those could create the gap, without the channel causing anything. As lesson 6.3 warned, a link is not a cause.

So Nadia asks for a randomized coupon test, next quarter. That is the design from lesson 6.5. If Fernway assigns shoppers to the two coupon types at random, the groups start out alike. Then a gap in redemption can be pinned on the coupon itself. Same coupon test. Same formula. But a much stronger conclusion, because chance, not the shopper, picked the group.

Common Mistake

Pool Counts, Do Not Average Rates

Here is a common mistake. Someone averages the two proportions, instead of pooling the counts. With 36.7 percent and 26.0 percent, the simple average is 31.3 percent. But the pooled rate is 31.1 percent. Why the difference? Because the groups differ in size. Pooling counts gives the bigger group its fair weight. Here, the gap between the two answers is small. But with groups of very different sizes, the simple average can drift far from the right rate.

Try it yourself. In the practice file, set the grocery group to 58 redeemers out of 200. Predict z first. Will it grow, or shrink? Then run it. Hint: the grocery rate moves closer to the online rate, so the gap gets smaller. A smaller gap, with about the same standard error, means a smaller z. Then check whether it still clears the cutoff.

Key Takeaways

The Two-Proportion Test in Brief

Key takeaways. To compare two proportions, first pool the counts, under the null hypothesis. P bar is x one plus x two, over n one plus n two. Then z is the gap between the two sample proportions, divided by the square root of p bar, times one minus p bar, times one over n one plus one over n two. Each group needs about 10 successes and 10 failures. The z test matches the two by two chi-square test, because chi-square is z squared. And a significant gap is a link, not proof of a cause, unless shoppers were randomly assigned.

Next, in lesson 11.9, you will compare measurements taken on the same shoppers, before and after, with matched pairs. This lesson was made by UPI Study.

About Marketing Research at UPI Study

Marketing Research (Marketing 300) is a self-paced online course of 101 video lessons in 13 chapters, from consumer behavior, segmentation and the research process to qualitative methods, surveys and sampling, measurement, experiments, secondary and syndicated data, descriptive statistics, hypothesis tests, correlation and regression, research ethics and reports. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Principles of Marketing vs Marketing Research

Why take it here

Why students take Marketing Research with UPI Study

Turn customer questions into evidenceMarketing Research teaches how companies find out what customers want: defining the problem, interviews and focus groups, survey design and sampling, measurement scales, experiments, secondary and syndicated data, and data analysis from descriptive statistics to hypothesis tests, cross-tabs and regression, ending with the research report. It suits marketing and business degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Marketing Research carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Hypothesis Testing for Differences Between Two Proportions

How do you calculate a two-proportion z test?
Pool the successes and sizes of both groups, compute the standard error from that pooled rate, and divide the gap in rates by it. With 66 of 180 online shoppers redeeming a coupon, 36.7%, against 52 of 200 grocery shoppers, 26.0%, the pooled rate is 118 of 380, about 31.1%. The standard error is about 0.0475, z is about 2.24 and the two-tailed p-value is about 0.025.
Why do you pool the proportions in a two-proportion z test?
H0 says both groups share one true rate, so the best estimate of that rate under H0 combines all the data. Pool by adding the success counts and dividing by the total sample size, not by averaging the two rates, which gives the wrong answer when the groups differ in size. The confidence interval, by contrast, uses each group's own rate.
How is a two-proportion z test related to the chi-square test?
For a 2x2 table, the chi-square test of independence without a continuity correction gives exactly the square of the two-proportion z statistic and the same two-tailed p-value. In the shopper example, z is about 2.244 and chi-square is about 5.035, which is 2.244 squared. The z version has the advantage of showing direction and supporting one-tailed tests.
How do you build a confidence interval for the difference between two proportions?
Add and subtract 1.96 standard errors around the gap between the two sample rates, using each group's own rate: multiply each rate by one minus it, divide by its group size, add the two results and take the square root. For 66 of 180 against 52 of 200, the gap of 0.107 gives a 95% interval of about 0.014 to 0.200. It excludes zero, matching the test, but its low end shows the advantage might be small.

About the Marketing Research course

How many college credits is Marketing Research?
Marketing Research (Marketing 300) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Marketing Research cost and what is included?
$250, paid once, with lifetime access: all 101 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Marketing Research take?
It is self-paced with no deadlines. The 101 lessons total about 19 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Marketing Research.

101 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Updated

Marketing Research
3 credits · NCCRS
Enroll →