ANOVA: Comparing Differences Across Three or More Groups

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

ANOVA: Comparing Differences Across Three or More Groups

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

← Understanding t-Tests: Assessing Statistical Differences Between GroupsNext lesson: The Z Test: Formula and Examples →

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

In this lesson

Compare three or more group means with one F test.

  • Explain why running many t-tests on the same data raises the false-alarm risk
  • Read an ANOVA table with sums of squares, degrees of freedom, F and the p-value
  • Interpret what a significant F does and does not tell you
  • Name post hoc tests used to find which groups differ

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,510 words). Read along, or search it.

Opening Question

Three Pack Designs, Eight Stores Each

Fernway Snacks, a composite case built for teaching, has three designs for its snack bar pack: Classic, Green, and Bold. Leo tried each design in eight Larkfield stores, and tracked weekly sales. Green looks best. But with three groups, who is "different" from whom?

Could Leo compare every pair with a separate test? The surprising answer is that doing so quietly rigs the game against him. ANOVA tests all the groups at once.

By the end of this lesson, you will explain why several t-tests on the same data raise the false-alarm risk. You will read an ANOVA, with its F statistic, its degrees of freedom, and its p-value. And you will know what a significant F does, and does not, tell you.

Multiple Tests

False-Alarm Risk Grows With Pairs

First: why not just run many t-tests? With three packs, there are three pairs. Classic against Green. Classic against Bold. And Green against Bold.

Each t-test, at an alpha of 0.05, has a five percent false-alarm chance. That is the Type I error, from lesson 11.1. Run three tests, and the chance that at least one cries wolf grows.

How fast does it grow? Treat the tests as independent, as a rough guide. One test, one pair: 5.0 percent. Three groups, three pairs: 14.3 percent. Four groups, six pairs: 26.5 percent. Five groups, ten pairs: 40.1 percent.

Rigged Game

Forty Percent Risk With Five Groups

So more groups mean more pairs. And more pairs mean more chances for a false alarm. With five groups, the risk is about forty percent, not five. That is the rigged game. Each test looks fair on its own. But together, they give luck many chances to fool you. And the more chances luck gets, the more likely it is that one of them lands. ANOVA asks one overall question first, so it keeps alpha at 0.05.

Core Idea

Between-Group Versus Within-Group Spread

Next, the idea: between-group spread, versus within-group spread. ANOVA compares two kinds of variation.

Stores that carry the same pack still differ from each other. Why? Location. Shoppers. Luck. That is the within-group variation. It is the background noise.

The pack means also differ from the grand mean, the average of all the stores. That is the between-group variation.

Here is the logic. If the pack designs do nothing, the group means differ only because of the noise. So the two kinds of variation should be about equal. But if the designs matter, the between-group spread is much bigger.

Now the data. These are units sold, per store, per week, and the numbers are invented. Classic: 41, 38, 45, 40, 43, 37, 42, 44.

Green: 47, 50, 44, 49, 46, 52, 48, 45. And Bold: 43, 46, 41, 47, 44, 42, 45, 48.

Data and Hypotheses

Overlapping Ranges, Separate Centers

The group means are 41.25 for Classic, 47.62 for Green, and 44.50 for Bold. The grand mean is 44.46.

Picture each store as a dot. The three pack means sit apart. But the stores within each pack are spread out, too. ANOVA measures the first spread, against the second. Look at Classic. Its stores range from 37 to 45. Now look at Green. Its stores range from 44 to 52. The ranges overlap a little. But the centers sit clearly apart. That is exactly the pattern ANOVA is built to detect.

Now, the hypotheses, in words. The null: all three packs have the same true mean weekly sales. The alternative: at least one pack's true mean is different. In symbols, the null says mu one equals mu two equals mu three. The alternative says not all mu are equal. Alpha is 0.05.

Formula

Sums of Squares and Degrees of Freedom

The formula, in words. F is the mean square between groups, divided by the mean square within groups. And a mean square is a sum of squared distances, divided by its degrees of freedom.

Let us unpack the two sums. The sum of squares between groups takes each group's size, times the squared distance of its mean from the grand mean. Then it adds those up. The sum of squares within groups takes each store's squared distance from its own group's mean. And it adds those up, over all the stores.

Then come the degrees of freedom. Between groups, it is the number of groups, minus one. With three packs, that is 2. Within groups, it is the total number of stores, minus the number of groups. With twenty-four stores and three packs, that is 21.

Python's numbers fit the standard ANOVA table. Between packs: a sum of squares of 162.58, with 2 degrees of freedom. So the mean square is 81.29.

F Statistic

Signal Eleven Times the Noise

Within packs: a sum of squares of 147.38, with 21 degrees of freedom. So the mean square is 7.02. The total sum of squares is 309.96, with 23 degrees of freedom.

So the between-pack mean square is about 11.6 times the within-pack one. That ratio is F, at 11.58. If the designs had no effect, F would usually be near one. Why one? Because then both mean squares would measure the same thing: the background noise. Noise over noise is about one. Here, the signal between packs is more than eleven times the noise inside them.

A few facts about F. It can never be negative, because it is built from squares. And its curve is lopsided. For 2 and 21 degrees of freedom, the cutoff for the top five percent is 3.467.

Decision

Far Beyond the 3.467 Cutoff

Our F is far beyond that cutoff. Luck alone would almost never produce it. Why is the curve lopsided? Most of the time, when nothing is going on, F lands near one. Values far above one are rare. And values below zero cannot happen at all. So the curve bunches up on the left, and trails off to the right. The red tail on the right holds the top five percent.

The decision. The p-value is 0.0004. That is below 0.05. And F, at 11.58, is above 3.467. So we reject the null hypothesis.

This means the three packs at Fernway do not all sell the same. Pack design matters, for sales. Think about what that saves. Leo ran one test, not three. His false-alarm risk stayed at five percent. And he still learned that something real is going on, among the packs.

Limits

Which Group Differs Needs a Post Hoc Test

Now, what a significant F does not tell you. ANOVA answers one question only. Are the means all equal? A significant F says no: at least one is different. But it does not say which one.

Green has the highest sample mean. But F alone does not prove that Green beats Bold. To find which pairs differ, while still controlling the false-alarm risk from Part 1, analysts follow up with a post hoc test. Examples are Tukey's test, or a Bonferroni-adjusted comparison. We name them here only. The software runs them.

ANOVA also makes assumptions. Each group should be roughly bell-shaped. The groups should have similar spread. And the stores should be independent of each other. When that fails, lesson 11.5 shows other options.

Common Mistake

Significant F Does Not Mean All Differ

Leo points at the table, back at the office. "Green wins!" Grace shakes her head. "The F test says the packs are not all the same. To say Green beats Bold, I need a follow-up test, one that accounts for comparing several pairs." The planner adds a line: run a post hoc test before choosing a design. Notice the order. First, one overall test, to ask whether anything differs. Then, a careful follow-up, to ask what differs. That order is what keeps the false-alarm risk under control.

Here is a common mistake. People read "significant F" as "every group differs from every other." That is wrong. One odd group can make F significant, while the other two are nearly identical. So look at the group means, and run a post hoc test, before naming winners.

Fun Fact

Named for Ronald Fisher

A fun fact. The F statistic is named in honor of Ronald Fisher. He was a British statistician. He developed ANOVA in the early nineteen hundreds. He worked at first with data from agricultural field trials. Which field of wheat grew best? It is the same question, with packs instead of plots.

Try it yourself. In the practice file, add four to every number in the Bold group. Predict first. Will F rise, or fall? Then run it, and check your guess against the between-group mean square. Here is a hint. Adding four moves Bold's mean up, but it does not change the spread of Bold's own stores. So only one of the two mean squares moves.

Key Takeaways

One Overall Test, Then Follow-Ups

Key takeaways. Running a t-test on every pair piles up the false-alarm risk. One-way ANOVA compares three or more means, with one test. F is the mean square between, over the mean square within. That is between-group variation, over within-group variation. Its degrees of freedom are k minus one, and N minus k. A big F means the groups differ more than stores within a group do. A significant F says the means are not all equal. And a post hoc test is needed to say which ones differ.

Next, in lesson 11.4, you will meet the z test, used when the population's standard deviation is known. 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 ANOVA: Comparing Differences Across Three or More Groups

Why use ANOVA instead of multiple t-tests?
Running a t-test on every pair raises the chance of at least one false alarm. Treating the tests as independent, three pairs at an alpha of 0.05 give about a 14.3% chance of a false positive, and ten pairs give about 40.1%. One-way ANOVA tests all the group means at once, keeping the overall false-alarm risk at the chosen alpha.
How is the F statistic calculated in one-way ANOVA?
F is the mean square between groups divided by the mean square within groups, where each mean square is a sum of squares divided by its degrees of freedom: k minus 1 between and N minus k within. With 3 groups of 8 stores, sums of squares of 162.58 between and 147.38 within give mean squares of 81.29 and 7.02, so F is 11.58.
What does a significant ANOVA result tell you?
It tells you that the group means are not all equal, so at least one differs. It does not say which groups differ, or that every group differs from every other. To identify specific pairs while controlling the false-alarm risk, analysts follow up with a post hoc test, such as Tukey's test or a Bonferroni-adjusted comparison.
What are the assumptions of one-way ANOVA?
Each group should be roughly bell-shaped, the groups should have similar spread, and the observations, such as individual stores, should be independent of each other. When these conditions fail badly, for example with heavily skewed data or outliers, a rank-based alternative such as the Kruskal-Wallis test is often used instead.

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 →