How Science Works

Factorial Designs: Testing Several Factors at the Same Time

Understand how factorial experiments test several factors at once, how to calculate main effects and interactions, and when a fraction of the runs will do.

Key takeaways

  • A factor is something you set deliberately, and its levels are the settings you try; a full factorial tests every combination.
  • A main effect is the average change in the result when one factor moves between levels, taken across the other factors.
  • An interaction means the effect of one factor differs depending on another, so quoting one average effect can mislead.
  • Runs multiply quickly, so fractional designs trade some information for fewer trials and must be chosen with care.
  • Randomize the run order and replicate where you can, so that chance variation is not mistaken for an effect.

A factorial design is an experiment that tests every combination of the chosen settings of two or more factors. It tells you what each factor does on average and also whether the effect of one depends on the setting of another, which changing a single thing at a time can easily miss.

It is also economical. Every run contributes information about every factor, so you often learn more from the same number of runs.

Factors, levels and cells

A factor is a variable you choose and set, such as temperature or fertilizer type. Its levels are the particular settings, such as 20 °C and 30 °C. Each distinct combination of levels is a cell or treatment combination.

Count combinations by multiplying the numbers of levels. Two factors at two levels each give 2 × 2 = 4 combinations, written as a 2 × 2 or 2² design. Three two-level factors give 2³ = 8. A design with one factor at three levels and another at four has 3 × 4 = 12.

The factors can be numerical, like time or concentration, or categories, like two brands of filter paper. The thing you measure is the response.

Why not change one thing at a time?

The familiar advice is to vary one factor while holding the rest fixed. That works when factors act independently. When they do not, it can steer you wrong.

Imagine baking where a higher oven temperature helps only if the baking time is shorter. If you first vary temperature while time is fixed long, higher temperature looks bad and you reject it. Then you vary time at the low temperature and settle on a modest answer. The good combination of hot and brief was never tried.

A factorial design tries all four corners, so that combination gets its chance. It also measures the effect of temperature under more than one condition, which tells you how widely the finding applies.

A worked example

Say you are growing seedlings and want to know about light and water. All numbers below are made up for illustration. The response is average height in centimeters after two weeks, with several pots in each cell.

Less water More water
Low light 6 8
High light 9 15

Main effect of light. Average the high-light cells and the low-light cells, then subtract.

High light average = (9 + 15) ÷ 2 = 12
Low light average  = (6 + 8) ÷ 2  = 7
Main effect of light = 12 − 7 = 5 cm

Main effect of water.

More water average = (8 + 15) ÷ 2 = 11.5
Less water average = (6 + 9) ÷ 2  = 7.5
Main effect of water = 11.5 − 7.5 = 4 cm

Interaction. Compare the effect of water under each light level.

Water effect in low light  = 8 − 6  = 2 cm
Water effect in high light = 15 − 9 = 6 cm
Interaction = (6 − 2) ÷ 2 = 2 cm

Dividing by 2 is the usual convention for two-level designs. Some texts report the full difference of 4 cm, so check which definition a source uses.

Example 2 × 2 design: seedling height (made-up values)
Low light, less water 6 cm Low light, more water 8 cm High light, less water 9 cm High light, more water 15 cm Low light, less water 6 cm Low light, more water 8 cm High light, less water 9 cm High light, more water 15 cm

Water adds 2 cm in low light and 6 cm in high light.

Reading an interaction

In the example, extra water helps in both light conditions, but three times as much in high light. Saying "water adds 4 cm" is true as an average and describes neither situation well. The honest summary gives both numbers.

If you plot the response against water level, with one line for each light level, parallel lines indicate no interaction. Lines with different slopes indicate one. Lines that cross, or slopes with opposite signs, are the most dramatic case: a factor helps in one setting and harms in another. A main effect near zero can then hide two large effects that cancel.

For that reason, look at interactions before interpreting main effects. And remember that an interaction can depend on the measurement scale. A pattern that is not additive in raw units may become additive when you work with logarithms or ratios, as happens when factors multiply each other.

Using every run more than once

In the 2 × 2 example, the light comparison used all the pots, half at each level. So did the water comparison. Two separate one-factor experiments with the same precision would need more pots in total, and neither would estimate the interaction.

The gain grows with more factors. In a 2³ design with one run per cell, each main effect compares an average of four runs with an average of four others, using all eight.

Averaging also helps with noise, but it does not replace independent replicates. Several leaves measured on one plant, or repeated readings from one batch, do not show how much separately treated units differ. Without true replication you have little direct basis for judging whether a difference exceeds chance.

Adding a third factor

Suppose you add pot size to the seedling study, giving 2 × 2 × 2 = 8 combinations. You can now estimate seven effects:

  • three main effects: light, water and pot size
  • three two-factor interactions: light with water, light with pot size, water with pot size
  • one three-factor interaction

A three-factor interaction means that the interaction between two factors itself changes with the third. For instance, light and water might reinforce each other strongly in large pots and hardly at all in small ones, where cramped roots hold growth back.

Each two-level effect can be computed with a simple sign rule. Code the low level of every factor as −1 and the high level as +1. For an interaction, multiply the codes of the factors involved. Then subtract the average response of the runs marked −1 from the average of the runs marked +1. In the 2 × 2 example, the runs marked +1 for the interaction are the two where light and water are both low (6) or both high (15).

Average of +1 runs = (6 + 15) ÷ 2 = 10.5
Average of −1 runs = (8 + 9) ÷ 2  = 8.5
Interaction = 10.5 − 8.5 = 2 cm

This matches the earlier result. The rule scales to any number of two-level factors, which is why a spreadsheet handles these designs comfortably.

Running it fairly

A good layout can still be spoiled by the order of work. If you run all the high-temperature trials in the morning and the low ones in the afternoon, temperature is tangled with time of day.

  1. List every combination, including replicates.
  2. Assign units and run order at random, using a random number generator or shuffled cards.
  3. If you must split the work across days or batches, treat each as a block and try to include all combinations in each.
  4. Hold other conditions steady and record them.
  5. Decide before looking how you will analyze main effects and interactions.

The logic behind step 2 is set out in randomization as a research tool. Factorial results are commonly analyzed with analysis of variance or regression, which estimate the effects and their uncertainty together.

Sometimes one factor is hard to change, such as furnace temperature. Running all trials at one temperature before switching is called a split-plot arrangement. It is acceptable, but the analysis must reflect it.

When the runs multiply too fast

Seven two-level factors give 2⁷ = 128 combinations before any replication. A fractional factorial runs a carefully selected subset, such as a half or an eighth.

The cost is aliasing (also called confounding of effects): some effects can no longer be separated, because they would produce the same pattern in the runs you chose. In a half fraction of three factors, with four runs, a main effect can be indistinguishable from the interaction of the other two.

Experimenters accept this when they have reason to think high-order interactions are small, and they pick fractions that keep the important effects apart from one another. Screening with a fraction, then following up on the few factors that seem to matter, is a common strategy. If a surprising result could come from two aliased effects, only additional runs can settle it.

Limits and good habits

Two levels can show that a response changes, but not its shape between or beyond them. A response that rises and then falls may look flat if you test one low and one high value that happen to match. Adding center points, runs midway between the levels, can reveal curvature. Reaching past your tested range is a form of extrapolation, with the usual risks.

With many factors you also get many effects to examine: a 2⁵ design has 31 main effects and interactions. Some will look interesting by luck. Treat unplanned discoveries as leads to confirm in a new experiment.

Planning your first one

Pick two or three factors you have a reason to care about, and set each level far enough apart to produce a visible change but within the range you would actually use. Choose a response you can measure consistently. A numerical response such as time, mass or length is usually more informative than "worked" or "failed."

Write the table of combinations before you begin, with a blank column for results and another for notes. If one cell turns out to be impossible, such as a mixture that never sets, that is itself an interaction worth recording, though the missing value complicates the arithmetic.

Report the cell averages as well as the effects. A reader can reconstruct the pattern from four or eight averages, and may care about a particular combination more than about any average across them.

Finally, choose levels that are safe and realistic. Combinations can create conditions that no single factor would, such as high temperature together with high pressure. Review every cell for hazards before you run it, and work under qualified supervision where equipment or chemicals are involved.

Written for 4Sciences with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 49 articles in How Science Works →

Latest news on this topic