← All topics

Step 4 · Complex designs · Topic 14 of 17 · 10 min

Two factors and repeated measures

Main effects and factor interactions, plus repeated measurements on the same experimental units.

In short#

  • Two-way ANOVA tests the main effect of A, the main effect of B and the A × B interaction separately.
  • A significant interaction indicates that the effect of one factor varies across levels of the other. Main effects average over the other factor. To see how levels differ, inspect simple effects and account for multiplicity across the full comparison family.
  • For an independent design, Type III ANOVA tests main effects as equal-weight marginal hypotheses using sum contrasts. Each cell needs at least two observations; empty combinations are not supported.
  • Repeated-factor tests assume sphericity. The Greenhouse-Geisser correction adjusts degrees of freedom and p-values. In mixed ANOVA, factor A defines independent groups of experimental units and factor B is measured repeatedly on the same units.

In plain words#

Two factors can affect an outcome at once, such as coating and load or fertiliser and weather. Two-way ANOVA tests the main effect of each factor and whether the effect of one factor changes across levels of the other.

An interaction means that the difference between conditions changes across levels of another factor. If a coating helps at low load but hurts at high load, its average effect hides this pattern. Compare simple effects separately at each load level.

Repeated measurements on the same experimental unit are linked and cannot be treated as independent. Repeated-measures ANOVA accounts for this using the unit ID; Linza requires complete data across all conditions for this analysis.

In Linza#

  1. Add a Grouped table in long format: each row contains levels A and B and one value. Enter an experimental-unit ID for repeated and mixed designs.
  2. In Study setup, define the levels and design: independent, repeated or mixed. Independent designs use different units in each cell; repeated designs measure the same units at each B level; mixed designs use A for groups of units and repeat B within each group.
  3. Results show model effects, cell summaries and simple comparisons. The selected Bonferroni or Šidák adjustment applies to p values across the full comparison family. Estimable differences have simultaneous 95% confidence intervals with a separate Bonferroni adjustment. The coating and load example opens with data ready to inspect.
Try it in Linza Opens in a new tab with synthetic data. Work in the original tab remains unchanged.

Common mistakes#

  • Interpreting an average main effect without checking interaction and simple effects.
  • Treating repeated measurements from one unit as independent or leaving out its ID.

Check yourself#

A fertiliser has a stronger effect on yield in a dry year than in a wet one. What is this pattern called?

Optional. Your answer is not saved.

Sources#

  • Maxwell S.E., Delaney H.D., Kelley K. (2018) Designing Experiments and Analyzing Data: A Model Comparison Perspective. 3rd ed. Routledge. Search for publication Opens in a new tab
  • Greenhouse S.W., Geisser S. (1959) On methods in the analysis of profile data. Psychometrika, 24(2). Search for publication Opens in a new tab
  • Krzywinski M., Altman N. (2014) Two-factor designs. Nature Methods, 11. Open publication Opens in a new tab

References are for further reading. A method’s suitability depends on the study design and its assumptions.