A regression factor is a categorical predictor represented by level indicators and contrasts. Treating year as a regression factor permits arbitrary differences between the three yearly means, reflecting conditions such as weather, rather than imposing a linear time trend.
Let be the yield for seed variety , fertiliser level , and year . A treatment-coded two-factor normal linear model with additive year effects is
with independent errors. The unrestricted coefficients are : six parameters for twelve observations. Equivalently use baseline-zero variety, fertiliser, and interaction arrays. There are no year-treatment interactions in this fit.
Dividing each sum of squares by its statistical degrees of freedom gives the completed analysis of variance:
In particular, the missing interaction statistic is . Its null hypothesis is , against : the change in mean yield from high fertiliser is the same for both varieties. Under the null hypothesis and the independent homoscedastic normal linear model, this nested-model F-test has distribution . The printed -value 0.001137 strongly rejects no interaction.
Do not drop fertiliser just because its main-effect ANOVA row has . In this balanced factorial design that row measures a fertiliser effect averaged over varieties; large opposite effects can cancel. The strongly supported interaction requires retaining its associated main effects by regression model hierarchy. Seed and year also have evidence of effects in their ANOVA rows, so this table alone gives no compelling simplification of the fitted terms.
The interaction contrast is , with standard error 0.7946. The fitted high-minus-low fertiliser effect is for variety 1 but for variety 2. The fitted variety-2-minus-variety-1 contrast is under low fertiliser and under high fertiliser. Thus variety 2 performs best under low fertiliser, while high fertiliser benefits variety 1 and reduces variety 2's fitted yield. The marginal fertiliser effect is only .
The four fitted means in the baseline year are for respectively. Add in 2005 and in 2006 to every fitted mean. The 2005 coefficient has under a test of a zero contrast with 2004; the analogous 2006 contrast has . The latter is lack of evidence for a difference, not proof that the yearly means coincide. Standard errors for the combined contrasts require the coefficient covariance matrix. The experiment is small: residual standard error is 0.6882 on only six statistical degrees of freedom. If the same fields were reused, possible within-field dependence and field allocation would need checking before treating the fitted error independence as established.
Regression factor 2026-10-07
A regression factor is a categorical variable encoded by indicator columns or treatment contrasts in a statistical model. A factor with observed levels normally contributes statistical degrees of freedom when an intercept is present. The reference level in a regression factor has coefficient zero under treatment contrasts. Coding a year as a factor permits arbitrary year effects rather than imposing a linear trend.