Two-Way ANOVA Calculator
Paste your data as one line per observation — level of factor A, level of factor B, score — and get the two-way ANOVA table with both main effects and the interaction, partial η² for each, a table of cell and marginal means, and an interaction plot you can download. Unbalanced designs are handled correctly with Type III sums of squares. Free, no sign-up.
Separate the three fields with commas, tabs, or semicolons (use tabs or semicolons if your numbers have a decimal comma). A header line is skipped, so you can paste straight from a spreadsheet.
0 observations read
Enter observations for every combination of the two factors' levels, with at least one combination measured more than once.
How to Use the Two-Way ANOVA Calculator
- 1. Name the factors. Type what factor A and factor B are — Caffeine and Time of day, say. The names label the table, the plot, and the APA line.
- 2. Paste the data in long format. One observation per line: the level of A, the level of B, and the score, separated by commas, tabs, or semicolons. Three columns copied from a spreadsheet work as they are, header row included.
- 3. Check the design. Every combination of levels needs at least one observation, and at least one combination needs two or more so there is within-cell variation to test against. Each factor can have 2–8 levels.
- 4. Read the effects in order. Look at the interaction first, then the main effects, using the cell means and the plot. Copy the APA line for all three tests.
Main Effects and the Interaction
A two-way ANOVA answers three questions at once. The main effect of A asks whether the marginal means of A's levels differ when you average over B; the main effect of B asks the same for B; and the A × B interaction asks whether the effect of one factor changes from one level of the other to the next. Each test is an F ratio, F = MSeffect / MSerror, where the error term is the pooled variation of scores around their own cell mean, with N − ab degrees of freedom for a design with a levels of A and b levels of B.
| Source | df | What it tests |
|---|---|---|
| Factor A | a − 1 | Do A's marginal means differ, averaging over B? |
| Factor B | b − 1 | Do B's marginal means differ, averaging over A? |
| A × B | (a − 1)(b − 1) | Does the effect of A depend on the level of B? |
| Error | N − ab | Variation of scores around their own cell mean |
Partial η² = SSeffect / (SSeffect + SSerror) — the share of the variance not explained by the other effects that this effect accounts for.
Worked Example: Caffeine and Time of Day
Click Try an example to load memory scores from 18 participants, three in each of six cells: a low or high caffeine dose, tested in the morning, afternoon, or evening. The cell means are 13, 16, and 11 for the low dose and 19, 22, and 11 for the high dose, so caffeine adds six points in the morning and the afternoon and nothing in the evening. The design is balanced, which makes the sums of squares easy to check by hand.
Two-way ANOVA table
Caffeine: SS = 72, df = 1, F(1, 12) = 18.00, p = .001, ηₚ² = .60
Time of day: SS = 196, df = 2, F(2, 12) = 24.50, p < .001, ηₚ² = .80
Caffeine × Time of day: SS = 36, df = 2, F(2, 12) = 4.50, p = .035, ηₚ² = .43
Error: SS = 48, df = 12, MS = 4; Total: SS = 352, df = 17
With equal cells, SSA = bn Σ(ȳi − ȳ)²: the dose means are 13.33 and 17.33 around a grand mean of 15.33, so SSA = 3 × 3 × (2² + 2²) = 72. The interaction is significant, F(2, 12) = 4.50, p = .035, ηₚ² = .43, and the plot shows why: the two lines run parallel from morning to afternoon, then meet in the evening. That is also the reason to report the main effect of caffeine with care — a six-point average benefit describes two of the three testing times, not all three.
Balanced vs Unbalanced Designs
When every cell has the same number of observations, the effects are uncorrelated and every way of computing the sums of squares — Type I, II, or III — gives the same table. With unequal cell sizes they disagree, because the effects overlap. This calculator reports Type III sums of squares: each effect is tested after adjusting for every other effect, including the interaction, which compares the unweighted marginal means. That matches SPSS's default and R's car::Anova(type = 3) with sum-to-zero contrasts. In an unbalanced design the Type III sums of squares no longer add up to the total, and that is expected rather than an error.
Frequently Asked Questions
- What is an interaction effect in a two-way ANOVA?
- An interaction means the effect of one factor depends on the level of the other. In the example, caffeine raises scores by six points in the morning and afternoon but not at all in the evening. On an interaction plot, an interaction shows up as lines that are not parallel — they converge, diverge, or cross.
- Should I interpret main effects when the interaction is significant?
- Cautiously. A main effect averages over the levels of the other factor, and when the interaction is significant that average can hide very different patterns. Describe the cell means, then test simple effects — the effect of one factor at each level of the other — if your question calls for it.
- What is the difference between Type I, II, and III sums of squares?
- They differ only in unbalanced designs. Type I adds effects in order, so the result depends on which factor you enter first. Type II tests each main effect adjusted for the other main effect but not the interaction. Type III adjusts each effect for all others and tests unweighted marginal means; it is the SPSS default and the one this calculator reports.
- What does two-way ANOVA with replication mean?
- That each combination of factor levels has more than one observation. Replication is what provides the within-cell error term, and it is what makes the interaction testable. Without replication — one value per cell — the interaction and the error cannot be separated, and the calculator will ask for more data.
- How do I report a two-way ANOVA in APA style?
- Report each effect with its own F test and effect size, usually the interaction last or first depending on your story: F(1, 12) = 18.00, p = .001, ηₚ² = .60 for caffeine; F(2, 12) = 24.50, p < .001, ηₚ² = .80 for time of day; and F(2, 12) = 4.50, p = .035, ηₚ² = .43 for the interaction. Give the cell means and SDs in a table or the text, and say that the sums of squares are Type III if the design is unbalanced.
- Can I use this for repeated measures?
- No. The calculator assumes every observation comes from a different participant — a between-subjects design. If the same people were measured under several conditions, the observations are correlated and you need a repeated-measures or mixed ANOVA, which this tool does not run.