Topics / Chapter 9

Testing two factors together

To study two factors such as variety and fertilizer in the same trial and see whether the effect of one depends on the other.

Asking two questions in one trial

You want to know which of three wheat varieties yields most and how much nitrogen to apply. You could run two separate trials, one for varieties and one for nitrogen rates. But that way you can never ask the really important question:

Does every variety respond to nitrogen in the same way?

Perhaps one variety doubles its yield with 12 kg of nitrogen while another stops responding after 6 kg. The only way to see this is to test every variety × rate combination together in the same trial. This is a factorial experiment. 3 varieties × 3 rates make 9 combinations; in a randomized complete block design, each combination appears once in every block.

A factorial experiment has two advantages:

  • It reveals interaction: whether the effect of one factor changes with the level of the other.
  • It is more economical. Every plot gives information about both factors at once. In the variety comparison, each variety’s mean comes from all the plots of all three rates.

What is an interaction?

Three effects are tested in the ANOVA table:

EffectQuestion it asks
Variety (A)Averaged over all rates, do the varieties differ?
Nitrogen (B)Averaged over all varieties, do the rates differ?
Variety × Nitrogen (A×B)Does the effect of nitrogen depend on the variety?

An interaction means the two factors don’t act independently. It is easiest to see in the interaction plot, where one line is drawn for each variety: if the lines are parallel there is no interaction, meaning nitrogen affects every variety by the same amount. If the lines diverge, converge or cross, there is an interaction.

If the interaction is significant, the interpretation changes. Saying “the best rate on average is 12 kg” becomes misleading, because 12 kg may be best for one variety while giving the same result as 6 kg for another. Comparisons are then made separately for each variety.

In what order should the results be read?

  1. Look at the interaction first. If A×B is significant, don’t interpret the main effects on their own; compare within each row (each level of A) of the two-way table.
  2. If the interaction is not significant, move to the main effects. Compare the marginal means of the significant factor. These means hold across all levels of the other factor.
  3. Translate the result to the field. For example: “Variety B with 12 kg of nitrogen gave the highest yield; in Variety C, more than 6 kg did not increase yield.”
Design
Example:

Three wheat varieties received three nitrogen rates (0, 6, 12 kg/da); each combination was tested in 3 blocks (randomized complete blocks). Yield (kg/da) was measured. Do the varieties respond to nitrogen in the same way?

VarietyNitrogenBlock 1Block 2Block 3
Variety A0 kg
6 kg
12 kg
Variety B0 kg
6 kg
12 kg
Variety C0 kg
6 kg
12 kg
  • VarietysignificantF = 148.2, p < 0.0001
  • NitrogensignificantF = 267.14, p < 0.0001
  • Variety × NitrogensignificantF = 21.96, p < 0.0001
Analysis of variance table
Source of variationdfSSMSF
Block23612.961806.4835.79 **
Variety214963.197481.59148.2 **
Nitrogen226971.6313485.81267.14 **
Variety × Nitrogen44434.811108.721.96 **
Error16807.750.48
Total2650790.3

* significant at 5%, ** at 1%, ns: not significant. CV = 1.61%.

4004505000 kg6 kg12 kgNitrogenVariety A, 0 kg: 397Variety A, 6 kg: 439.67Variety A, 12 kg: 470Variety AVariety B, 0 kg: 414.33Variety B, 6 kg: 473.67Variety B, 12 kg: 530Variety BVariety C, 0 kg: 389Variety C, 6 kg: 428Variety C, 12 kg: 430.67Variety C
Each line is one level of Variety. Parallel lines mean no interaction; if they diverge, converge or cross, the effect of Nitrogen depends on Variety.

What does the interaction say?

The interaction is significant: the effect of Nitrogen depends on the Variety. So “the best Nitrogen” has no single answer; comparisons should be made separately for each Variety. The best Nitrogen level is the same for every Variety (12 kg), but the size of the response differs: the range across levels is 115.7 for Variety B and only 41.7 for Variety C.

Means (letters: Nitrogen levels compared within each Variety, Duncan)
Variety \ Nitrogen0 kg6 kg12 kgVariety mean
Variety A397c439.67b470a435.56
Variety B414.33c473.67b530a472.67
Variety C389b428a430.67a415.89
Nitrogen mean400.11447.11476.89441.37

Because the interaction is significant, the main-effect means (margins) should not be interpreted on their own; the letters in each row compare the Nitrogen levels at that level of Variety. Duncan (5%) critical ranges: R2 = 12.3, R3 = 12.9.

How were the sums of squares calculated?
  1. Correction factor: the square of the grand total divided by the number of plots.

    CF=(∑X)2a⋅b⋅r=1191723⋅3⋅3=5259810.7CF = \dfrac{(\sum X)^2}{a \cdot b \cdot r} = \dfrac{11917^2}{3 \cdot 3 \cdot 3} = 5259810.7
  2. Total sum of squares:

    SST=∑X2−CF=50790.3SS_T = \sum X^2 - CF = 50790.3
  3. Block sum of squares: each block total squared, divided by the plots per block (a·b).

    SSBl=∑Bk29−CF=3612.96SS_{Bl} = \dfrac{\sum B_k^2}{9} - CF = 3612.96
  4. Variety sum of squares: each Variety level total comes from 9 plots.

    SSA=∑Ai2b⋅r=∑Ai29−CF=14963.19SS_A = \dfrac{\sum A_i^2}{b \cdot r} = \dfrac{\sum A_i^2}{9} - CF = 14963.19
  5. Nitrogen sum of squares: each Nitrogen level total comes from 9 plots.

    SSB=∑Bj2a⋅r=∑Bj29−CF=26971.63SS_B = \dfrac{\sum B_j^2}{a \cdot r} = \dfrac{\sum B_j^2}{9} - CF = 26971.63
  6. Interaction: from the variability between combinations (A×B cells), subtract what each factor explains on its own. What remains is how the factors affect each other.

    SSAB=∑Tij2r−CF−SSA−SSB=46369.63−14963.19−26971.63=4434.81SS_{AB} = \dfrac{\sum T_{ij}^2}{r} - CF - SS_A - SS_B = 46369.63 - 14963.19 - 26971.63 = 4434.81
  7. Error: subtract the parts explained by blocks and combinations from the total.

    SSE=SST−SSBl−(SSA+SSB+SSAB)=807.7SS_E = SS_T - SS_{Bl} - (SS_A + SS_B + SS_{AB}) = 807.7
  8. Error degrees of freedom (a·b − 1)(r − 1) = 16. All three F values use the same error:

    FA=148.205,FB=267.144,FAB=21.963F_A = 148.205, \quad F_B = 267.144, \quad F_{AB} = 21.963
  9. Each F value is compared with the F table value for its degrees of freedom; significance levels are marked with stars.

Comparison details: Duncan’s multiple range test

Means are ranked; a larger critical difference is used for means far apart in rank and a smaller one for neighbours. Widely used in agricultural field trials.

  1. Rank the means from largest to smallest. The critical range depends on how many means (p) the pair spans.

    Rp=qαp; p; 16MSE3,αp=1−(1−α)p−1R_p = q_{\alpha_p;\,p;\,16} \sqrt{\dfrac{MS_E}{3}}, \qquad \alpha_p = 1 - (1 - \alpha)^{p-1}
  2. Critical ranges:

    R2=12.3,R3=12.9R_{2} = 12.3,\quad R_{3} = 12.9
  3. If a wider range is not significant, the differences between means inside it are also declared not significant.

  4. Means whose difference is below the critical value share a letter. 3 of 3 pairs differ significantly.

In the example all three effects are significant at the 1% level. In the interaction plot Variety B’s line is the steepest, while Variety C’s line levels off after 6 kg. Looking at the letters in the two-way table, you’ll see 6 and 12 kg share a letter for Variety C. Giving that variety 12 kg of nitrogen is money wasted.

Degrees of freedom

In a factorial experiment with aa levels of A, bb levels of B and rr blocks:

Sourcedf
Blockr−1r - 1
Aa−1a - 1
Bb−1b - 1
A × B(a−1)(b−1)(a-1)(b-1)
Error(ab−1)(r−1)(ab - 1)(r - 1)
Totalabr−1abr - 1

The degrees of freedom of A, B and A×B add up to the treatment degrees of freedom (ab−1ab - 1) the abab combinations would have in a single-factor trial. The factorial analysis splits the treatment sum of squares into these three meaningful parts.

Split plots: when one factor needs large plots

Some practices can’t be applied to small plots. Irrigation, tillage method or sowing date are usually applied to large areas; switching a drip line on and off for a 2 m plot is not practical. To test such a factor together with variety, the split-plot design is used:

  1. Each block is divided into as many large main plots as the first factor has levels. The first factor (irrigation) is randomized to the main plots.
  2. Each main plot is divided into as many subplots as the second factor has levels. The second factor (variety) is randomized within each main plot.

This has an important consequence for the analysis: two separate error terms are needed.

  • Error (a), the main-plot error. Irrigation levels are compared between large plots far apart from each other, where soil differences are large. And each block has only one main plot per irrigation level. So irrigation is tested against a large error with few degrees of freedom and is measured less precisely.
  • Error (b), the subplot error. Varieties are compared on small, neighbouring plots within the same main plot, a much more precise comparison. Variety and the irrigation × variety interaction are tested against this small error.
Design
Example:

Irrigation (main plot: dry, irrigated) and three chickpea varieties (subplot) were tested in 4 blocks. Irrigation can only be applied to large plots, so it is the main plot factor; each main plot was split into three subplots and the varieties were randomized among them. Yield (kg/da) was measured.

In a split-plot design factor 1 is the main plot (applied to large plots) and factor 2 is the subplot.

IrrigationVarietyBlock 1Block 2Block 3Block 4
DryVariety 1
Variety 2
Variety 3
IrrigatedVariety 1
Variety 2
Variety 3
  • IrrigationsignificantF = 63.71, p = 0.0041
  • VarietysignificantF = 110.56, p < 0.0001
  • Irrigation × VarietysignificantF = 5.8, p = 0.0173
Analysis of variance table
Source of variationdfSSMSF
Block36796.132265.381.51 ns
Irrigation195887.0495887.0463.71 **
Error (a)34515.131505.04
Variety221558.3310779.17110.56 **
Irrigation × Variety21130.33565.175.8 *
Error (b)12117097.5
Total23131056.96

* significant at 5%, ** at 1%, ns: not significant. CV (a) = 10.23%, CV (b) = 2.6%. Irrigation and blocks were tested against Error (a); Variety and the interaction against Error (b).

300350400450500Variety 1Variety 2Variety 3VarietyDry, Variety 1: 313.5Dry, Variety 2: 346Dry, Variety 3: 288.75DryIrrigated, Variety 1: 431.75Irrigated, Variety 2: 491.75Irrigated, Variety 3: 404Irrigated
Each line is one level of Irrigation. Parallel lines mean no interaction; if they diverge, converge or cross, the effect of Variety depends on Irrigation.

What does the interaction say?

The interaction is significant: the effect of Variety depends on the Irrigation. So “the best Variety” has no single answer; comparisons should be made separately for each Irrigation. The best Variety level is the same for every Irrigation (Variety 2), but the size of the response differs: the range across levels is 87.8 for Irrigated and only 57.3 for Dry.

Means (letters: Variety levels compared within each Irrigation, Duncan)
Irrigation \ VarietyVariety 1Variety 2Variety 3Irrigation mean
Dry313.5b346a288.75c316.08
Irrigated431.75b491.75a404c442.5
Variety mean372.63418.88346.38379.29

Because the interaction is significant, the main-effect means (margins) should not be interpreted on their own; the letters in each row compare the Variety levels at that level of Irrigation. Duncan (5%) critical ranges: R2 = 15.21, R3 = 15.92.

Why two separate errors?

Irrigation is applied to large main plots, so each block has only one main plot per Irrigation level. Soil differences between main plots get mixed into the Irrigation comparison, so Irrigation is tested against the main-plot error (MS = 1505.04), which is much larger than the subplot error.

Had the data been wrongly analysed as a plain factorial, Irrigation would get F = 252.99 (p < 0.0001); the correct analysis gives F = 63.71. The wrong analysis makes the effect of Irrigation look far more certain than it is.

How were the sums of squares calculated?
  1. Correction factor: the square of the grand total divided by the number of plots.

    CF=(∑X)2a⋅b⋅r=910322⋅3⋅4=3452692.04CF = \dfrac{(\sum X)^2}{a \cdot b \cdot r} = \dfrac{9103^2}{2 \cdot 3 \cdot 4} = 3452692.04
  2. Total sum of squares:

    SST=∑X2−CF=131056.96SS_T = \sum X^2 - CF = 131056.96
  3. Block sum of squares: each block total squared, divided by the plots per block (a·b).

    SSBl=∑Bk26−CF=6796.13SS_{Bl} = \dfrac{\sum B_k^2}{6} - CF = 6796.13
  4. Irrigation sum of squares: each Irrigation level total comes from 12 plots.

    SSA=∑Ai2b⋅r=∑Ai212−CF=95887.04SS_A = \dfrac{\sum A_i^2}{b \cdot r} = \dfrac{\sum A_i^2}{12} - CF = 95887.04
  5. Variety sum of squares: each Variety level total comes from 8 plots.

    SSB=∑Bj2a⋅r=∑Bj28−CF=21558.33SS_B = \dfrac{\sum B_j^2}{a \cdot r} = \dfrac{\sum B_j^2}{8} - CF = 21558.33
  6. Interaction: from the variability between combinations (A×B cells), subtract what each factor explains on its own. What remains is how the factors affect each other.

    SSAB=∑Tij2r−CF−SSA−SSB=118575.71−95887.04−21558.33=1130.33SS_{AB} = \dfrac{\sum T_{ij}^2}{r} - CF - SS_A - SS_B = 118575.71 - 95887.04 - 21558.33 = 1130.33
  7. Main plot error: in each block every Irrigation level is one main plot. Subtract the block and Irrigation parts from the variability of main plot totals.

    SSE(a)=∑(AB)ik2b−CF−SSBl−SSA=107198.29−6796.13−95887.04=4515.13SS_{E(a)} = \dfrac{\sum (AB)_{ik}^2}{b} - CF - SS_{Bl} - SS_A = 107198.29 - 6796.13 - 95887.04 = 4515.13
  8. Subplot error: the remaining variability.

    SSE(b)=SST−SSBl−SSA−SSE(a)−SSB−SSAB=1170SS_{E(b)} = SS_T - SS_{Bl} - SS_A - SS_{E(a)} - SS_B - SS_{AB} = 1170
  9. Degrees of freedom: Error (a) = (r − 1)(a − 1) = 3, Error (b) = a(r − 1)(b − 1) = 12.

  10. Irrigation is compared between main plots, so it is divided by the main plot error:

    FA=95887.041505.04=63.711F_A = \dfrac{95887.04}{1505.04} = 63.711
  11. Variety and the interaction are compared within the same main plot, so they are divided by the subplot error:

    FB=10779.1797.5=110.556,FAB=565.1797.5=5.797F_B = \dfrac{10779.17}{97.5} = 110.556, \qquad F_{AB} = \dfrac{565.17}{97.5} = 5.797
  12. Each F value is compared with the F table value for its degrees of freedom; significance levels are marked with stars.

Comparison details: Duncan’s multiple range test

Means are ranked; a larger critical difference is used for means far apart in rank and a smaller one for neighbours. Widely used in agricultural field trials.

  1. Rank the means from largest to smallest. The critical range depends on how many means (p) the pair spans.

    Rp=qαp; p; 12MSE4,αp=1−(1−α)p−1R_p = q_{\alpha_p;\,p;\,12} \sqrt{\dfrac{MS_E}{4}}, \qquad \alpha_p = 1 - (1 - \alpha)^{p-1}
  2. Critical ranges:

    R2=15.21,R3=15.92R_{2} = 15.21,\quad R_{3} = 15.92
  3. If a wider range is not significant, the differences between means inside it are also declared not significant.

  4. Means whose difference is below the critical value share a letter. 3 of 3 pairs differ significantly.

In a split-plot design, Variety comparisons within the same Irrigation level use Error (b). Comparing Irrigation levels within the same Variety level requires combining the two errors; this calculator does not do that.

With “Split plot” selected, the calculator also shows what the same data would give if analysed as a plain factorial. When the main-plot error is mixed with the subplot error, the F value for irrigation becomes about four times larger, and the irrigation effect looks far more certain than it is.

Which factor goes on the main plots?

  • The factor whose application needs large areas goes on the main plots: irrigation, tillage, sowing date.
  • The factor whose precise comparison matters more goes on the subplots. The main-plot factor is always measured more coarsely.
  • The interaction is tested against the subplot error, so it is measured precisely. Split plots are a good design for studying interactions too.

Specify the design correctly in the analysis: the same numbers give different results when analysed as a factorial or as a split plot. Which analysis is right is decided not by the data but by how the trial was laid out in the field. If randomization was done on main plots, the analysis must be a split-plot analysis.