Two-Way ANOVA Calculator

Measure two main effects and their interaction in a balanced 2 x 2 factorial design.

Two-way ANOVA with replication
Enter equally sized replicate samples for each combination of two factors and two levels.

About two-way ANOVA

Two-way analysis of variance examines one continuous outcome across combinations of two categorical factors. A 2 x 2 design has two levels of Factor A, two levels of Factor B, and four cells representing every possible combination. Unlike separate one-way tests, the factorial model estimates both main effects and an interaction in a single analysis. This calculator analyzes balanced designs with replication, meaning every cell must contain the same number of independent observations and at least two observations are needed per cell. The Factor A main effect compares the average outcome across A1 and A2 after averaging over both levels of Factor B. The Factor B main effect similarly compares B1 and B2 after averaging over Factor A. The interaction tests whether the effect of one factor changes depending on the level of the other factor. An interaction can be important even when neither main effect is large. For example, two treatments might have opposite effects in two age groups, producing equal overall treatment means but a strong crossover interaction. The calculator partitions variation into Factor A, Factor B, A-by-B interaction, and residual error. Each effect sum of squares has one degree of freedom in a 2 x 2 design. Residual variation is computed from differences between observations and their own cell means. Dividing each effect mean square by the residual mean square produces its F-statistic. Larger F values indicate that an effect is large compared with unexplained variation. Formal p-values require evaluating each statistic against an F distribution with one numerator degree of freedom and the displayed error degrees of freedom. Interpretation depends on standard ANOVA assumptions: independent observations, approximately normal residuals in every cell, and similar variances across cells. Balanced samples make the analysis more robust and keep the effects orthogonal, but they do not correct poor randomization, outliers, or dependent measurements. If the interaction is meaningful, interpret simple effects or cell comparisons before summarizing main effects, because averaging can conceal the pattern. Report cell means and variability alongside F statistics, degrees of freedom, p-values, and effect sizes. This tool is intended for transparent calculations, classroom examples, and quick verification of balanced replicated designs.

Two-way ANOVA examples

Four cells: A1B1 | A1B2 | A2B1 | A2B2F statisticsInterpretation
1,2,3 | 3,4,5 | 5,6,7 | 7,8,9A = 48; B = 12; A x B = 0Additive main effects
1,2,3 | 7,8,9 | 7,8,9 | 1,2,3A = 0; B = 0; A x B = 108Pure crossover interaction
4,5,6 | 4,5,6 | 4,5,6 | 4,5,6A = 0; B = 0; A x B = 0No systematic factorial effects

How to calculate a two-way ANOVA

  1. Arrange independent observations into the four combinations of Factor A and Factor B.
  2. Confirm that every cell has the same number of numeric replicates.
  3. Enter each cell's values separated by commas or spaces.
  4. Select Calculate Two-Way ANOVA and compare the two main-effect and interaction F-statistics.

Frequently asked questions

What is an interaction effect?

An interaction means the effect of one factor depends on the level of the other factor. It should be explored with cell means or simple effects rather than interpreted only through main effects.

Why must all four samples be the same size?

This calculator uses balanced-design formulas that keep the factorial effects independent. Unequal cell sizes require a general linear model and an explicit choice of sums-of-squares type.

What does replication mean in two-way ANOVA?

Replication means each factor-level combination contains multiple independent observations. It provides a direct estimate of residual error needed to test the interaction.

Can I use repeated measurements?

Not with this independent-samples calculator. Repeated observations on the same subjects require a repeated-measures or mixed-effects model that accounts for dependence.

Should I interpret main effects when interaction is large?

Use caution because an average main effect may hide very different effects across levels. Examine the four cell means and test planned simple effects first.