Analysis of variance (ANOVA): comparing three or more means
People were split into three groups and given a placebo or one of two drug doses. The average drop in blood pressure came out as 2, 5 and 8 mmHg. Are the groups really different, or did it just happen by chance? Drag the group means yourself and see a way to check all of them in one go. Every number on this page is made up, and the page explains a statistics idea, nothing more.
Short answer. Analysis of variance (ANOVA) checks in one go whether three or more groups all have the same mean. Divide "the spread between groups" by "the spread within groups". If that number (F) is large, the group means are too far apart to blame on chance.
| Sum of squares | df | Mean square | F | p | |
|---|---|---|---|---|---|
| Between groups | |||||
| Within groups | |||||
| Total |
Each point is one person. Drag the circle at the right end of a group mean (black bar) up or down, or type in the number boxes. The sliders change the spread within groups and the number of people per group. The table is the ANOVA table for the current data. The picture below it shows where the current F sits on the F distribution (orange) and the 5% line (purple). The points were made up with a fixed-seed random number generator and then adjusted so each group's mean and standard deviation match the controls exactly. So, unlike real data, every group has exactly the same standard deviation (a small toy version). With three people per group you get the worked example.
Definitions
The text below uses three drug dose groups. These are the textbook definitions (one-way analysis of variance). There are k groups, group i has nᵢ people, and the total number of people is N = n₁ + … + nₖ. is the j-th value in group i, x̄ᵢ is the mean of group i, and x̄ is the overall mean.
- between-group sum of squares
- The squared distance from each group mean to the overall mean, counted once per person in the group, all added up. It is the between sum of squares SSB in the text.
- within-group sum of squares
- The squared distance from each value to its own group mean, all added up. It is the within sum of squares SSW in the text.
- total sum of squares
- The squared distance from each value to the overall mean, all added up. It equals the between-group sum of squares plus the within-group sum of squares.
- degrees of freedom, mean square
- The degrees of freedom for between groups, within groups and total are k − 1, N − k and N − 1. A sum of squares divided by its degrees of freedom is a mean square.
- F statistic
- The between-group mean square divided by the within-group mean square. If the values are independent, each group follows a normal distribution with the same variance, and the null hypothesis is true, F follows the F distribution with (k − 1, N − k) degrees of freedom. The p-value is the area to the right of the observed F under that distribution.
1. What it asks: the null and alternative hypotheses
Say people were randomly split into three groups and given a placebo, dose 1 or dose 2, and we measured how much their blood pressure dropped. The group means almost always differ a little. Even if the drug did nothing, different people ended up in each group, so the means differ by chance. ANOVA asks: "Can chance alone explain means this far apart?"
Here the "true mean" μ (mu) is the mean you would get if you gave the same treatment to a huge number of people. What we have is the mean of a few of them (the sample mean). Following hypothesis testing, we set up two hypotheses.
| Hypothesis | Formula | Meaning |
|---|---|---|
| Null hypothesis H₀ | μ₁ = μ₂ = … = μₖ | All groups have the same true mean. The differences we see are chance |
| Alternative hypothesis H₁ | at least one μᵢ is different | Not "all are different". One different group is enough for H₁ |
k is the number of groups. The name says "variance", but what it compares is means. It finds out whether the means differ by comparing two kinds of spread (variance). With only two groups it gives the same answer as a t-test (section 7). It earns its keep with three or more groups (section 8).
2. Spread between ÷ spread within
Whether means of 2, 5 and 8 are "far apart" depends on how much people differ from each other. If people in the same group sit within about ±1 of each other, means 3 apart are a clear difference. If people in the same group differ by ±10, a gap of 3 can easily happen by chance.
- Spread between groups: how far the group means are from the overall mean. It grows if the drug has an effect.
- Spread within groups: how far each person is from their own group's mean. This is the difference between people that has nothing to do with the drug (noise).
If the drug does nothing, the group means only wobble as much as people differ, so the two spreads are similar and F is near 1. The further apart the group means, the bigger F gets. "How big before it is not chance?" is settled by the F distribution (section 4). The number of people matters too. With more people, each group mean wobbles less, so the same gap between means is more convincing and F gets bigger.
Try this. (The lab at the top) ① The starting picture is the worked example in section 6. F = 27 ÷ 4 = 6.75, degrees of freedom (2, 6), p = 0.029. It sits to the right of the 5% line at 5.14. ② Drag dose 2's mean down from 8 to 5 and you get F = 2.25, p = 0.187. ③ Go back to "Start values" and raise the spread within groups from 2 to 4. The means are unchanged, but F = 1.69, p = 0.262: now it "could be chance". ④ From "Start values", raise the people per group from 3 to 10. F = 22.5, degrees of freedom (2, 27), p < 0.001. The 5% line also drops to 3.35. ⑤ Press "Make all means equal" and you get F = 0, p = 1.000. With real data the sample means differ a little by chance, so F is rarely exactly 0. ⑥ Press "4 groups" and a fourth group (mean 8) joins: F = 6.19, degrees of freedom (3, 8), p = 0.018.
3. Splitting the sum of squares in two
Spread is measured the way variance is: square the distances and add them up. That total is called a sum of squares. The heart of ANOVA is cutting each point's "distance to the overall mean" into two pieces.
x is one person's value, x̄ᵢ ("x bar i") is the mean of the group i that person is in, and x̄ is the overall mean of everyone. The left side is "to the overall mean". The first piece on the right is "to your own group mean" (within). The second piece is "from the group mean to the overall mean" (between). Square these over all points and add them up, and they split cleanly:
Press a point to pick it (black ring). Drag to move that whole group up or down. The groups are the same data as the lab at the top. Blue is within groups, green is between groups, the purple outline is the total. The bar on the right always has the height of the total sum of squares, so just look at the share of each color.
Try this. ① At the start, total 78 = between 54 + within 24, so the between share is 69.2%. ② The picked point (dose 2, person 3, value 10) is 5 = 2 + 3 away from the overall mean 5. But squared, 5² = 25 while 2² + 3² = 13, so one point on its own does not split. It only splits when you add up all points (why: step ③ in section 4). ③ Drag dose 2 up to 11 and you get total 150 = between 126 + within 24. The between share grows to 84.0%. Moving a group leaves the within sum of squares at 24, because the shape inside each group did not change. ④ Press "Make all means equal" (in the lab at the top) and all the green pieces vanish: total 24 = between 0 + within 24.
4. How the formula is built
This is the central formula. k is the number of groups and N is the number of people in total.
Press "Next" in the lab below to build it one step at a time. The picture uses the same data as the lab at the top.
In the formula above, the orange background marks the piece added in this step. A piece with a 0 under it is a piece that becomes 0 and drops out. To change the groups, drag them in the lab at the top or in section 3. This picture follows along.
Written only as formulas, the steps above are:
- Overall mean and total sum of squares:
SST = Σ(x − x̄)². The overall mean of the 9 points is 5. Square each point's distance to the overall mean (the purple lines) and add them up: 78. That is one number for how spread out all the data is. What we want to know is how much of this spread comes from the group differences. - Cut each distance in two:
(x − x̄ᵢ) + (x̄ᵢ − x̄). Split the purple line into a blue piece (to your own group mean) and a green piece (from the group mean to the overall mean). We only subtracted the group mean once and added it back, so this is always true. - Square and add: total = between + within,
SST = SSW + SSB. Since (a + b)² = a² + b² + 2ab, you might expect a cross term2Σ(x − x̄ᵢ)(x̄ᵢ − x̄)to be left over, but it is always 0. Why, in one line: inside one group, (x̄ᵢ − x̄) is the same number for everyone, so it can be pulled out, and what is left, Σ(x − x̄ᵢ), is 0 by the very meaning of a mean. Check it with the worked example: for dose 2, (6 − 8) + (8 − 8) + (10 − 8) = 0, and the same holds in all three groups. So 78 = 24 + 54. The green pieces are the same value repeated once per person in the group, so the between sum of squares is also writtenSSB = Σ nᵢ(x̄ᵢ − x̄)²(nᵢ is the number of people in group i). - Divide by degrees of freedom to get mean squares:
MSB = SSB ÷ (k − 1),MSW = SSW ÷ (N − k). A sum of squares just grows when there are more points or more groups. So we divide by "the number of pieces that are free to move" (the degrees of freedom) to put them on the same footing. The k group means are tied to the overall mean, so one of them is fixed by the others, and between has k − 1 = 2 degrees of freedom. The N people are each tied to their own group mean, one tie per group, so within has N − k = 6. 54 ÷ 2 = 27 and 24 ÷ 6 = 4. These are called mean squares, and now they can be compared even when the number of groups and people differ. - Their ratio is F:
F = (SSB ÷ (k − 1)) ÷ (SSW ÷ (N − k)). 27 ÷ 4 = 6.75. MSW estimates the spread between people, σ², whether the means are equal or not. MSB estimates the same σ² when all means are equal, and gets bigger when they are not. So if all group means are equal, F is near 1. - Compare with the F distribution to get p. When all means are equal and the assumptions below (section 10) hold, F spreads out like the F distribution with degrees of freedom (k − 1, N − k). The area to the right of the current F is the p-value. Under F(2, 6), the area to the right of 6.75 is 0.029. F only grows as the means move apart, so we only look at the right tail.
Try this. ① At first the formula is just SST = Σ(x − x̄)², and the purple bar on the right reads SST 78. ② Press Next twice. The cross term gets a 0 under it and the text below says the cross term is 0. The bar splits into between 54 (69.2%) and within 24 (30.8%). ③ Press Next four times in total. The green MSB 27 bar gets a white tick at every MSW 4 height, and 6.75 of them fit. ④ The last step shows the area to the right of 6.75 under the F(2, 6) curve, p = 0.029. Raise the spread to 4 in the lab at the top and look again: MSW becomes 16 and F 1.69.
5. How to read an ANOVA table
Statistics software reports the result as a table like this. It has the same layout as the table in the lab above.
| Row | Sum of squares | df | Mean square | F | p |
|---|---|---|---|---|---|
| Between groups | SSB = Σ nᵢ(x̄ᵢ − x̄)² | k − 1 | MSB = SSB ÷ (k − 1) | MSB ÷ MSW | area to the right of F under the F distribution |
| Within groups | SSW = Σ(x − x̄ᵢ)² | N − k | MSW = SSW ÷ (N − k) | ||
| Total | SST = Σ(x − x̄)² | N − 1 |
- Check that it adds up. Sums of squares: between + within = total. Degrees of freedom too: (k − 1) + (N − k) = N − 1. If not, the table was copied wrong.
- Look at F. Near 1 means the group means differ about as much as people differ. Much bigger than 1 means they are further apart than that.
- Look at p. If it is below the significance level you chose (often 0.05), reject "all means are equal". When you write it up, include the degrees of freedom, like
F(2, 6) = 6.75, p = 0.029.
Row names differ between programs. The "between groups" row often shows up under the name of the grouping variable (for example, dose) or as Treatment. The "within groups" row often shows up as Residuals or Error.
Common misreadings
- "p = 0.029, so there is a 2.9% chance that all means are equal" is wrong. p is "the chance of getting an F this large or larger, if all means were equal". It is not the chance that a hypothesis is true (hypothesis testing).
- "p > 0.05, so all means are equal" is wrong. You only failed to reject. As in step ③ of the lab, with a lot of spread or few people, p can be large even when a real difference exists (statistical power).
- "F is significant, so every group differs from every other" is wrong. It only says at least one is different. Which one is the job of the post hoc comparisons in section 9.
- "F is big, so the effect is big" is wrong. With many people, even a small difference makes F big. The size of the difference is the effect size in section 11.
6. A worked example by hand
Three groups, three people each. Drop in blood pressure (mmHg, made-up numbers). This is the starting picture of the labs above.
| Group | Three people's values | Group mean x̄ᵢ | (x − x̄ᵢ)² | Within sum of squares |
|---|---|---|---|---|
| Placebo | 0, 2, 4 | 2 | 4, 0, 4 | 8 |
| Dose 1 | 3, 5, 7 | 5 | 4, 0, 4 | 8 |
| Dose 2 | 6, 8, 10 | 8 | 4, 0, 4 | 8 |
- Overall mean.
(0 + 2 + 4 + 3 + 5 + 7 + 6 + 8 + 10) ÷ 9 = 45 ÷ 9 = 5. - Between sum of squares. The group means are −3, 0 and 3 away from the overall mean, and each group has three people, so
3 × (9 + 0 + 9) = 54. - Within sum of squares. Add the last column of the table:
8 + 8 + 8 = 24. - Check with the total sum of squares. The distances to the overall mean 5 are −5, −3, −1, −2, 0, 2, 1, 3, 5, and their squares add up to
25 + 9 + 1 + 4 + 0 + 4 + 1 + 9 + 25 = 78 = 54 + 24. - Degrees of freedom. Between
k − 1 = 3 − 1 = 2, withinN − k = 9 − 3 = 6, totalN − 1 = 8. - Mean squares.
MSB = 54 ÷ 2 = 27,MSW = 24 ÷ 6 = 4. - F.
27 ÷ 4 = 6.75. - p. Under the F(2, 6) distribution, the area to the right of 6.75 is 0.029. The 5% line is at 5.14 and 6.75 is beyond it, so at the 5% significance level we reject "all three means are equal". Only when the first degree of freedom is 2 can you get the area with a short formula:
(1 + 2 × 6.75 ÷ 6)^(−6 ÷ 2) = 3.25^(−3) ≈ 0.0291. For other degrees of freedom, a computer does it, as in the labs on this page.
The same work as formulas:
| Sum of squares | df | Mean square | F | p | |
|---|---|---|---|---|---|
| Between groups | 54 | 2 | 27 | 6.75 | 0.029 |
| Within groups | 24 | 6 | 4 | ||
| Total | 78 | 8 |
# the same calculation in Python (scipy)
from scipy.stats import f_oneway
f_oneway([0, 2, 4], [3, 5, 7], [6, 8, 10]) # F = 6.75, p ≈ 0.029
7. Properties worth knowing
| Property | In plain words | In the labs |
|---|---|---|
| Total = between + within | Whatever the data, and even if groups have different numbers of people, the sum of squares always splits this way. The degrees of freedom split the same way | The bar in the section 3 lab |
| With two groups, F = t² | Square the t from the t-test that pools the two variances and you get F, with the same p-value. ANOVA is the t-test stretched to many groups | This page's lab.js self-check (add ?test to the address) |
| With equal means, F is near 1 | Because MSB and MSW estimate the same σ². To be exact, the mean of the F distribution is d₂ ÷ (d₂ − 2), a bit above 1 (d₂ is the within degrees of freedom, when it is above 2) | The section 8 lab: with no effect, F passes the 5% line about 5% of the time |
| Only the right tail counts | F is 0 or more, and it only grows when means move apart, in any direction. So p is one area on the right | The F picture in the lab at the top |
| More people make the same gap give a bigger F | With n people per group, SSB is n times bigger. With the same spread, the evidence piles up | Section 2, try this ④ |
8. Why not just run many t-tests?
With three groups there are three pairs (placebo vs dose 1, placebo vs dose 2, dose 1 vs dose 2). With k groups there are k × (k − 1) ÷ 2 pairs. If you run a t-test on each pair at the 5% significance level, each test has a 5% chance of saying "significant" even when there is no effect at all. Run many tests, and the chance that at least one comes out significant by luck goes up. If the tests were independent, it would be:
0.95 is "the chance one test is not significant", and if they are independent, the chance that none is significant is that number multiplied once per pair. The pairwise t-tests share groups, so they are not fully independent, and the real value is a bit lower than this formula. The lab below counts it directly: it runs 1,000 experiments on data with no effect at all (every group comes from the same distribution).
One cell is one experiment. In each experiment, every group gets 10 people, all drawn from the same normal distribution. So every orange cell is a mistake: an effect reported where there is none. The left and right grids use the same 1,000 data sets. The same seed gives the same result, and a different seed gives different luck.
Try this. ① At the start (3 groups, seed 1), the t-test for every pair called at least one pair significant in 122 of 1,000 experiments (12.2%). The formula 1 − 0.95³ gives 14.3%. ANOVA did so in 59 (5.9%), close to 5%. ② Raise the number of groups. The table below shows what seed 1 gives. With 8 groups there are 28 pairs, and more than half, 509 experiments (50.9%), wrongly say "something is different". ANOVA stays near 5% whatever the number of groups.
| Groups | Pairs | Formula 1 − 0.95^pairs | t-test for every pair (lab) | One ANOVA (lab) |
|---|---|---|---|---|
| 3 | 3 | 14.3% | 12.2% | 5.9% |
| 4 | 6 | 26.5% | 21.4% | 5.5% |
| 5 | 10 | 40.1% | 29.8% | 5.3% |
| 6 | 15 | 53.7% | 35.6% | 5.7% |
| 7 | 21 | 65.9% | 43.2% | 4.9% |
| 8 | 28 | 76.2% | 50.9% | 6.1% |
The lab values are below the formula because the pairs are not independent. The ANOVA column moving within 1 percentage point of 5%, like 5.9% and 4.9%, is just the luck of running only 1,000 experiments (around 5%, the typical wobble, the standard error, is about 0.7 percentage points). Either way the message is the same: the more groups, the further the chance of a false "significant" climbs above 5%. ANOVA asks "are all the means equal?" with one test, so it keeps the overall error at 5%. Ways to control this chance when you do run many tests (Bonferroni, Holm, false discovery rate) are on the multiple comparisons page.
9. What next: which group is different? (post hoc comparisons)
A significant F tells you "at least one is different". It does not tell you which group. So after the F test you compare pairs, a post hoc comparison. To avoid the problem in section 8, you make the bar stricter because there are many pairs (an adjustment). The simplest, the Bonferroni correction, divides the significance level 0.05 by the number of pairs m and uses that for each pair. Put an interval around each pair's difference in means:
t is the point of the t distribution with N − k degrees of freedom where the area in both tails together is 0.05 ÷ m. The spread is MSW, computed from all groups, not just the two. If the interval does not include 0, we say the two groups differ.
Same data as the lab at the top. Drag groups or change the number of people there, and this picture changes too. A thick line in orange is a pair whose adjusted interval does not include 0.
Try this. ① At the start (worked example) there are 3 pairs, so t = 3.29 is used. Only dose 2 − placebo = 6, with adjusted interval 0.63 to 11.37, leaves out 0. The other two pairs differ by 3 with interval −2.37 to 8.37, so we cannot say they differ. F was significant, but only one pair can be called different. ② The unadjusted interval (thin line) has a half-width of 4, narrower than the adjusted one (half-width 5.37). ③ Press "20 people each, means 4, 5, 6": only dose 2 − placebo = 2, interval 0.44 to 3.56, differs. ④ From "Start values", raise people per group to 10 and all three pairs differ (intervals 0.72 to 5.28, 3.72 to 8.28, 0.72 to 5.28).
When comparing every pair, people often use Tukey's method, whose intervals are a bit narrower than Bonferroni's. When you only compare each dose with the one placebo group, there is Dunnett's method. Whichever you use, it is best to decide "what to compare" before looking at the data. The F test and the post hoc comparisons sometimes disagree (F is significant but no pair is, or the other way round). That is because F looks at the spread of all the means together, not at one pair.
10. Assumptions, and what to do when they fail
Getting p from the F distribution works when the following hold.
| Assumption | In plain words | If it fails |
|---|---|---|
| Independence | Each value comes from a separate person. One person's value does not affect another's | If the same people were measured several times, use repeated measures ANOVA. Random assignment of people to groups is the basis of independence |
| Roughly bell-shaped | Within a group, people spread around their mean close to a normal distribution | With many people per group, the means get close to a bell shape, so it matters less. With few people and a very skewed shape or many outliers, use the Kruskal-Wallis test |
| Similar spread | Each group has a similar standard deviation (one MSW stands in for the spread of every group) | With the same number of people per group it matters less. With different numbers of people and different spreads it can go badly wrong. Use Welch's ANOVA |
Check with pictures first. Plot each group's points (like the pictures on this page) and write the group standard deviations side by side. There is also Levene's test, which tests whether the spreads are equal. The Kruskal-Wallis test does a job similar to ANOVA, but instead of the values it uses their ranks after lining up everyone's values in one row. Even if one outlier is very far away, its rank is just the last one, so the test is less thrown off. More on the nonparametric tests page.
11. Effect size: eta squared
The p-value only says "is this rare for chance?". It says nothing about how big the difference is. The size of the difference is written as eta squared (η²).
It is the share of the total spread taken up by the group differences, between 0 and 1. It is exactly the share of green in the bar of the section 3 lab. The worked example gives 54 ÷ 78 ≈ 0.69. "20 people each, means 4, 5, 6" has p = 0.010, smaller than the worked example's 0.029, but its η² is only 0.15. With many people, even a small difference can be told apart from chance, but next to the spread between people, the group difference is small.
η² counts differences that came from chance in the same data as group differences too, so with few people it tends to come out bigger than the real value. A corrected version, omega squared, ω² = (SSB − (k − 1) × MSW) ÷ (SST + MSW), is sometimes used instead. The worked example gives (54 − 2 × 4) ÷ (78 + 4) = 46 ÷ 82 ≈ 0.56.
12. Going further: two-way ANOVA, repeated measures, regression
Two-way ANOVA. So far there was one thing splitting the groups (one factor): the dose. That is one-way ANOVA. With two factors it is two-way ANOVA. For example, split by dose (placebo, dose 1, dose 2) and by diet (low salt, normal) at the same time, and you get six groups. The between sum of squares splits again into a "dose" part, a "diet" part and an interaction part. The interaction asks "does the effect of the dose depend on the diet?". If the dose difference is large only for people on a low-salt diet, there is an interaction, and then you cannot state "the effect of the dose" in one line apart from the diet. More on the factorial designs and interaction page.
Repeated measures. If you measure the same people at week 0, 4 and 8, the values are not independent. In return, you can separate out each person's own level and remove it from the within-group spread, so the same number of people can detect a smaller difference. See repeated measures and crossover designs.
The same frame as regression. One-way ANOVA is the same calculation as a linear regression whose inputs are "a 0-or-1 column for each group", and it gives the same F and p. The between sum of squares is the part the regression explains, and the within sum of squares is the regression's residual sum of squares (correlation and regression, least squares).
Where it is used
- Experiments with three or more doses or treatments. Body weight under three diets in an animal study, cell counts under four culture conditions: ANOVA is the first test for experiments with many groups. Splitting people into groups at random is on the random assignment page, and planning the experiment is on the clinical trial design page.
- A/B/C tests of several screens. Randomly split visitors across three versions of a web page and compare average time on page: same calculation. Repeating pairwise t-tests between screens runs into the problem in section 8.
- Feature selection in machine learning. In a classification problem, you can measure with F how much one feature (input) differs in mean across the answer classes, and keep the features with large F. scikit-learn's
f_classifcomputes this F value. - Comparing measuring methods. Measure the same samples on several machines and see whether the machines differ in mean.
Frequently asked questions
It compares means, so why is it called analysis of variance?
Because it decides whether the means differ by comparing two kinds of spread (variance). If the group means are more spread out than the spread between people can explain, we conclude the means really differ.
With two groups, should I use ANOVA or a t-test?
They give the same answer. With two groups, F is the square of t from the t-test that pools the two groups' variances, and the p-value is the same. People usually use a t-test for two groups and ANOVA for three or more.
If the F test is significant, are all the groups different from each other?
No. It only says that at least one group mean is different. To find which groups differ, you run a separate post hoc comparison such as Bonferroni or Tukey.
If the p-value is above 0.05, does that mean all the means are equal?
No. It means there was not enough evidence to detect a difference. With few people or a lot of spread, p can be large even when a real difference exists. To show that a difference is smaller than some amount, you need another method such as an equivalence test.
What if the assumptions do not hold?
If the spread is very different between groups, use Welch's ANOVA. If the shape is far from a bell or there are many outliers, use the Kruskal-Wallis test, which works with ranks. If the same people were measured several times, use repeated measures ANOVA.
Words
| Words used here | What books call it |
|---|---|
| checking in one go whether all means are equal | analysis of variance (ANOVA). One factor: one-way. Two factors: two-way |
| group / what splits the groups | group, treatment, level / factor |
| all means are equal / at least one is different | null hypothesis (H₀) / alternative hypothesis (H₁) |
| squared distances added up | sum of squares (SS) |
| between sum of squares | between-group sum of squares, treatment sum of squares (SSB) |
| within sum of squares | within-group sum of squares, error or residual sum of squares (SSW, SSE) |
| total sum of squares | total sum of squares (SST) |
| number of pieces free to move | degrees of freedom (df) |
| sum of squares ÷ degrees of freedom | mean square (MS): MSB, MSW (MSE) |
| between ÷ within | F statistic, F ratio |
| how F spreads when all means are equal | F distribution |
| the table of results | ANOVA table |
| chance of at least one false "significant" over many tests | familywise error rate (FWER) |
| comparing pairs to see which group differs | post hoc comparison, multiple comparisons |
| significance level ÷ number of pairs | Bonferroni correction |
| similar spread | homogeneity of variance, homoscedasticity |
| ANOVA when spreads differ | Welch's ANOVA |
| ANOVA with ranks | Kruskal-Wallis test |
| share of the total spread from group differences | effect size: eta squared (η²), omega squared (ω²) |
| an effect that depends on another factor | interaction |
| ANOVA when the same people are measured several times | repeated measures ANOVA |
| distance from your own group mean | residual |
Sources
- R. A. Fisher, Statistical Methods for Research Workers (1925). Chapter 7, "Intraclass correlations and the analysis of variance" covers ANOVA. Full text at Classics in the History of Psychology.
- NIST/SEMATECH e-Handbook of Statistical Methods: 7.4.3 Are the means equal?, 7.4.3.2 The one-way ANOVA model and assumptions, 7.4.3.3 The ANOVA table and tests of hypotheses about means.
- Same handbook: 7.4.7 How can we make multiple comparisons?, 7.4.7.3 Bonferroni's method, 7.4.1 the Kruskal-Wallis test, 1.3.5.10 Levene Test, 1.3.6.6.5 F Distribution.
- Areas under the F distribution come from the incomplete beta function. This page computes it with the continued fraction (8.17.22) in NIST DLMF §8.17.
- scikit-learn documentation: sklearn.feature_selection.f_classif.