Two-Way ANOVA

Calculate Two-Way ANOVA instantly with the exact formula and a worked example.

Two-Way ANOVA

Mean A1·B1
Mean A1·B2
Mean A2·B1
Mean A2·B2
Observations per cell
Within-cell SD (pooled)
F statistic for factor A
22.5
2×2 design with equal cell sizesCalculate Two-Way ANOVA instantly with the exact formula and a worked example.
p for factor A
< 0.001
F for factor B
10
p for factor B
0.0032
F for A×B interaction
2.5
p for A×B interaction
0.1226
df
1, 36

Run a two-way ANOVA on a balanced 2×2 design when all you have are the four cell means, the cell size and a pooled standard deviation, for example from a paper or a report.

How the calculation works

In a 2×2 design, two factors (A and B) each have two levels, giving four cells: A1·B1, A1·B2, A2·B1 and A2·B2. You enter each cell mean, the number of observations per cell n (equal for all cells) and the pooled within-cell standard deviation SD. The calculator finds the grand mean and the marginal means, then partitions the variability using Fisher’s classic decomposition.

Sums of squares: SS_A = 2n · Σ(level mean of A − grand mean)², SS_B likewise for factor B, and SS_AB = n · Σ(cell mean − row mean − column mean + grand mean)². The within-cell mean square equals SD², so each effect’s F = SS / SD² with 1 degree of freedom, and the error has 4(n − 1) degrees of freedom. The p-value comes from the F distribution.

The headline figure is the F statistic for factor A. Below it you get the p-value for A, F and p for factor B, F and p for the A×B interaction, and the degrees of freedom. An effect is conventionally called significant when p < 0.05.

Worked example

Defaults: cell means 10, 12, 14 and 20, n = 10 per cell, SD = 4. Grand mean 14; A level means 11 and 17; B level means 12 and 16. SS_A = 20 × (9 + 9) = 360, SS_B = 20 × (4 + 4) = 160, SS_AB = 10 × 4 × 1 = 40, SD² = 16. That gives F_A = 22.5 (p < 0.001), F_B = 10 (p ≈ 0.0032) and F_AB = 2.5 (p ≈ 0.12) with df = 1 and 36: both main effects are significant, the interaction is not.

Things to keep in mind

  • SD must be the pooled within-cell standard deviation, not the spread of the means and not the overall SD of all data. With equal n it is the square root of the average of the four cell variances.
  • The tool covers only 2×2 designs with equal cell sizes. Unbalanced data or more levels need statistical software with Type II or Type III sums of squares.
  • Look at the interaction first. If it is significant, interpret the main effects with care, because the effect of A depends on the level of B.
  • Check the assumptions: independent observations, roughly normal data within cells and similar variances (Levene’s test, for instance).
  • Effect size by hand: partial η² = SS_effect / (SS_effect + SD² × error df). For factor A in the example that is 360 / 936 ≈ 0.38.

More about: Two-Way ANOVA

What it calculates

The “Two-Way ANOVA” calculator computes F statistic for factor A from 6 parameters: mean a1·b1, mean a1·b2, mean a2·b1, mean a2·b2, observations per cell, within-cell sd (pooled).

A core calculation for studying, engineering tasks, and checking solutions.

Example calculation

With parameters Mean A1·B1 = 10, Mean A1·B2 = 12, Mean A2·B1 = 14, Mean A2·B2 = 20, Observations per cell = 10, Within-cell SD (pooled) = 4 the result is 22.5 (2×2 design with equal cell sizes).

How to use

  1. Enter mean a1·b1, mean a1·b2, mean a2·b1, mean a2·b2, observations per cell and within-cell sd (pooled) — each field above is adjustable with a slider.
  2. F statistic for factor A is calculated automatically as you type.
  3. Check the worked example below to see the formula applied to real numbers.
  4. Copy the result or bookmark this calculator.

Related calculators

FAQ

Why don’t I need the raw data?
For a balanced 2×2 design, the cell means, n and the pooled SD fully determine the ANOVA table, so the result matches an analysis of the original observations.
What does the A×B interaction mean?
That the effect of one factor differs across the levels of the other. In the example, B2 exceeds B1 by 2 at A1 but by 6 at A2.
Why not just run two t-tests?
Two-way ANOVA tests both factors and their interaction in one model with a shared error estimate, and avoids inflating the false-positive rate through many separate comparisons.
Where do df = 1 and 36 come from?
Each effect in a 2×2 design has one degree of freedom. The error term has 4 cells × (10 − 1) = 36.

More calculators in this category

Explore related free tools

Poisson DistributionExponential DistributionGeometric DistributionUniform DistributionNegative Binomial DistributionTwo-Sample t-TestOne-Sample z-TestTwo-Proportion z-TestBayes' TheoremDivisibility RulesDecimal to FractionDirect & Inverse Proportion