Coderhouse goes global

🌍

Read more

What Is ANOVA? How Data Analysts Compare Means Across Three or More Groups

AI Engineering

Build and ship real applications with LLMs, agents and automation.

8 weeks · Live online · View course →

Data Analytics

Go from zero to job-ready analyst with SQL, Python and BI tools.

10 weeks · Live online · View course →

Dan Patiño

AI Strategy & Innovation at Coderhouse

Data

What Is ANOVA? How Data Analysts Compare Means Across Three or More Groups

What Is ANOVA? How Data Analysts Compare Means Across Three or More Groups

ANOVA, short for analysis of variance, is a statistical test that checks whether the averages of three or more groups are different enough that the difference is unlikely to come from random chance. Analysts use it to answer questions like: does average order value differ across four marketing channels? Do three onboarding flows lead to different time-to-activation? Do support teams in different regions resolve tickets in different average times?

It matters because comparing groups two at a time with repeated t-tests inflates the chance of a false positive. ANOVA tests all groups in one step with a single significance level, and only then do you dig into which specific groups differ. It is a standard tool in hypothesis testing for analysts.

How ANOVA works

Despite its name, ANOVA compares means by comparing two kinds of variation:

  • Between-group variation: how far each group's mean is from the overall mean.

  • Within-group variation: how spread out the values are inside each group.

If the group means are far apart relative to the noise inside each group, the groups probably differ. That ratio is the F statistic. The null hypothesis is that all group means are equal; the alternative is that at least one is different. The NIST/SEMATECH e-Handbook of Statistical Methods explains the one-way ANOVA model and its sums of squares in detail.

The calculation, step by step

  1. Compute each group mean and the grand mean of all observations.

  2. Sum of squares between (SSB): for each group, multiply its size by the squared difference between its mean and the grand mean, then add them up.

  3. Sum of squares within (SSW): add the squared differences between each value and its own group mean.

  4. Degrees of freedom: between = number of groups − 1; within = total observations − number of groups.

  5. Mean squares: MSB = SSB / df between; MSW = SSW / df within.

  6. F = MSB / MSW, then get the p-value from the F distribution.

A worked example: three checkout designs

An ecommerce team tests three checkout designs and records the minutes it takes five test users in each group to finish a purchase:

  • Design A: 12, 14, 11, 13, 15 (mean 13)

  • Design B: 16, 18, 15, 17, 19 (mean 17)

  • Design C: 13, 15, 14, 12, 16 (mean 14)

The grand mean is about 14.67. SSB = 5 × [(13 − 14.67)² + (17 − 14.67)² + (14 − 14.67)²] ≈ 43.33. Each group has squared deviations of 10 around its mean, so SSW = 30. With 2 and 12 degrees of freedom, MSB ≈ 21.67 and MSW = 2.5, giving F ≈ 8.67.

The critical F value at a 0.05 significance level with (2, 12) degrees of freedom is about 3.89, and F = 8.67 corresponds to a p-value of about 0.005. You reject the null hypothesis: at least one design has a different average completion time.

After ANOVA: post-hoc tests

A significant ANOVA tells you that some difference exists, not where. Post-hoc tests such as Tukey's HSD compare every pair while controlling the overall error rate. In this example, Tukey's test shows Design B differs from A (p ≈ 0.005) and from C (p ≈ 0.028), while A and C are not significantly different (p ≈ 0.59). The practical conclusion: Design B is slower, and A and C perform similarly.

Running ANOVA in Python and spreadsheets

In Python, scipy.stats.f_oneway(a, b, c) returns the F statistic and p-value for a one-way ANOVA, as described in the SciPy documentation. For the follow-up, scipy.stats.tukey_hsd runs Tukey's pairwise comparisons. Libraries like statsmodels add two-way ANOVA tables. In Excel, the Analysis ToolPak includes "Anova: Single Factor," which produces the same table of sums of squares, F and p-value.

Types of ANOVA

  • One-way ANOVA: one factor with three or more groups, like the checkout example.

  • Two-way ANOVA: two factors at once, such as channel and device, including whether they interact.

  • Repeated measures ANOVA: the same subjects measured under several conditions or over time.

Assumptions and common mistakes

  • Independence. Each observation should belong to one group and not influence others.

  • Roughly normal residuals. ANOVA is fairly robust with reasonable sample sizes, but heavy skew or outliers can mislead. The Kruskal-Wallis test is a common non-parametric alternative.

  • Similar variances. If group spreads are very different, Welch's ANOVA is safer.

  • Do not stop at the p-value. Report group means, the size of the differences and, when possible, confidence intervals. A significant result with tiny differences may not matter for the business.

  • Do not run many t-tests instead. With three groups you would run three tests, and the chance of at least one false positive grows with every extra comparison.

When analysts use ANOVA

  • Experiments with more than two variants, a natural extension of A/B testing when the metric is a continuous value like revenue or time.

  • Comparing average performance across regions, teams, stores or cohorts.

  • Product analytics, such as session length across plan tiers.

  • Operations, like delivery times across warehouses.

FAQ

What is the difference between ANOVA and a t-test?

A t-test compares the means of two groups. ANOVA compares three or more in a single test. With exactly two groups, a one-way ANOVA and a standard two-sample t-test give equivalent results.

Can ANOVA be used with conversion rates?

ANOVA is designed for continuous outcomes. For yes or no outcomes like converted or not, a chi-square test or logistic regression is usually a better fit.

What does a large F value mean?

That differences between group means are large compared with the variation inside groups. Whether it is significant depends on the degrees of freedom, which is why you read it with the p-value.

Keep learning with Coderhouse

Comparing groups correctly is one of the skills that separates reliable analysis from guesswork. Explore the path that fits your goals:

  • Data Analytics Course — learn SQL, Python, statistics and dashboards to test hypotheses with real business data.

  • Forward Deployed AI Engineering Course — learn to build, evaluate and deploy production AI systems, where comparing variants statistically helps choose the best model or prompt.

  • GTM Engineer Course (waitlist) — join the waitlist for early access to the program focused on building AI-powered go-to-market systems, including multi-variant outbound and conversion experiments.

Dan Patiño

I'm Dan Patiño, head of AI Strategy & Innovation at Coderhouse. My day-to-day work involves merging the tactical management of e-commerce (CRO, Email Marketing and SEO) with the development of disruptive solutions. I specialize in building internal AI-powered apps to automate tasks and boost innovation within the team. I firmly believe that technology is strategy's best ally. To dive deeper into my professional journey, I'll be waiting for you on my LinkedIn profile.