Two-Way ANOVA Calculator
A two-way (two-factor) ANOVA examines how a dependent variable changes across two categorical factors in a single analysis. The difference produced by each factor on its own is called a main effect; the unexpected pattern the two factors create together is called an interaction effect. If, for example, a teaching method works differently in morning and evening sessions, only the interaction term reveals it.
From data entered one observation per line in the form "A level; B level; value", this calculator partitions the total sum of squares into A, B, A×B, and error components, and reports the degrees of freedom, mean square, F, p-value, critical F, and partial eta squared for every effect. It produces a cell-means table together with an interaction line plot, and checks up front whether the design is balanced (an equal number of observations in every cell).
Two-Way ANOVA Formulas (balanced design)
SS_total = ΣΣΣ (xᵢⱼₖ − x̄)² df = abn − 1 SS_A = b·n · Σᵢ (x̄ᵢ.. − x̄)² df = a − 1 SS_B = a·n · Σⱼ (x̄.ⱼ. − x̄)² df = b − 1 SS_AB = n · ΣᵢΣⱼ (x̄ᵢⱼ. − x̄ᵢ.. − x̄.ⱼ. + x̄)² df = (a−1)(b−1) SS_error = ΣΣΣ (xᵢⱼₖ − x̄ᵢⱼ.)² df = ab(n − 1) MS = SS / df , F_effect = MS_effect / MS_error Partial η² = SS_effect / (SS_effect + SS_error)
a is the number of levels of factor A, b the number of levels of factor B, and n the number of observations per cell. In a balanced design the four sums of squares add up exactly to the total SS; in an unbalanced design the factors become confounded (Type I, II, and III sums of squares give different results), which is why this calculator requires a balanced design. All three effects use the same error term (MS_error) as the denominator.
How to Calculate
- Write each observation on its own line as "A level; B level; value", separating the fields with semicolons.
- Enter the factor names — they are used in the results table, the plots, and the interpretation.
- Make sure the design is balanced: every A×B cell must hold the same number of observations, and at least 2; otherwise the calculator returns a clear error.
- Read the interaction row of the ANOVA table first: if it is significant, do not interpret the main effects on their own.
- Look at the interaction line plot; parallel lines mean no interaction, while crossing or diverging lines mean there is one.
- Report the partial eta squared values, and after a significant effect examine the cell means with Bonferroni-corrected comparisons.
Worked Examples
Method × Session — a strong interaction
The cell means are 85.50 for digital-evening, 79.00 for digital-morning, 72.50 for classic-morning, and 68.50 for classic-evening. The Method main effect is very strong at F(1, 12) = 112.322; p < 0.001 (ηp² = 0.903), while the Session main effect is not significant at F(1, 12) = 1.271; p = 0.282. The interaction, however, is significant at F(1, 12) = 22.424; p < 0.001 (ηp² = 0.651): the classic method works better in the morning and the digital method in the evening.
Yöntem × Oturum interaction — F: 22.424 · Interaction — p-value: p < 0.001 · Interaction — partial eta squared (ηp²): 0.651
Fertilizer × Irrigation — main effects only
The cell means of 21.00, 27.00, 31.00, and 37.00 form a perfectly additive pattern. The Fertilizer main effect is F(1, 8) = 300.000; p < 0.001 and the Irrigation main effect is F(1, 8) = 108.000; p < 0.001, while the interaction is entirely absent at F(1, 8) = 0.000; p = 1.000. The two lines in the interaction plot are exactly parallel, so the main effects can be interpreted directly.
Gübre × Sulama interaction — F: 0.000 · Interaction — p-value: p = 1.000 · Interaction — partial eta squared (ηp²): 0.000
A 3 × 2 design with no significant effects
This 3 × 2 design of three groups and two sexes has 3 observations per cell, N = 18 in total. The Group main effect is F(2, 12) = 0.224; p = 0.802, the Sex main effect is F(1, 12) = 0.017; p = 0.898, and the interaction is F(2, 12) = 0.328; p = 0.727 — no effect is significant. The grand mean is 50.389 and every cell mean is squeezed between 50.00 and 51.00.
Grup × Cinsiyet interaction — F: 0.328 · Interaction — p-value: p = 0.727 · Interaction — partial eta squared (ηp²): 0.052