Two Ways to Describe the Same Factorial Model
A two-factor experiment can be described by the mean response in every combination of factor levels, or by separating those means into an overall level, contributions associated with each factor, and any remaining joint pattern. These are two parameterizations of the same model: they organize the mean structure differently, but they do not change the predicted mean for any treatment combination.
The second description is useful because it gives names to different parts of the mean pattern. But those names are not automatically unique. A constraint is needed to distinguish, for example, the grand mean from the factor effects. This tutorial develops the connection between the two descriptions and shows how sum-to-zero constraints provide a unique decomposition.
The Cell-Means Model
Let factor A have \(a\) levels and factor B have \(b\) levels. Suppose the design is balanced, with \(n\) observations in each combination of levels. Write \(Y_{ijk}\) for the response from replicate \(k\) in cell \((i,j)\), where \(i=1,\ldots,a\), \(j=1,\ldots,b\), and \(k=1,\ldots,n\). The cell-means model is
Here \(\mu_{ij}\) is the population mean response at level \(i\) of A and level \(j\) of B. The errors \(\varepsilon_{ijk}\) are assumed independent, normally distributed with mean 0 and common variance \(\sigma^2\). Thus, \(Y_{ijk}\sim N(\mu_{ij},\sigma^2)\). The factors are fixed: the levels in the model are the particular levels of interest, rather than a random sample of possible levels.
This model assigns one mean to each of the \(ab\) cells. It is direct: each parameter answers the question, “What is the mean response in this particular combination of conditions?” A different parameterization expresses those same \(ab\) means using components.
Grand Mean, Factor Effects, and Interaction Effects
In the effects parameterization, the response is written as
The parameter \(\mu\) is the grand mean. The quantity \(\alpha_i\) is the effect associated with level \(i\) of factor A, and \(\beta_j\) is the effect associated with level \(j\) of factor B. The interaction effect \((\alpha\beta)_{ij}\) is the part of the cell mean that remains after accounting for the grand mean and the two factor effects.
The word “effect” here means a component of the model’s mean structure. In particular, an interaction component describes a departure from an additive pattern of factor contributions; it is not itself a separate cell mean. The cell mean predicted by this model is
Without constraints, many different choices of \(\mu\), \(\alpha_i\), \(\beta_j\), and \((\alpha\beta)_{ij}\) can yield the same set of cell means. The conventional sum-to-zero constraints remove this ambiguity:
The first two constraints say that the A effects sum to zero across A’s levels and the B effects sum to zero across B’s levels. The interaction constraints require the interaction components to sum to zero down each column and across each row of the cell table. The constraints center the effects around zero, so the grand mean serves as the overall reference level.
How to Convert Cell Means into Effects
For a balanced factorial table, the constrained parameters can be recovered directly from the cell means. The grand mean is the average of all \(ab\) cell means. The A effect at level \(i\) is the average of the cell means in row \(i\), minus the grand mean; the B effect is defined analogously using column \(j\). The interaction is what remains in a cell after subtracting the grand mean and its two factor effects.
The row and column averages here give each level of the other factor equal weight. That matches the balanced design, in which every cell has the same number of observations. The formulas describe the model parameters; for an observed dataset, the cell sample means can be substituted to calculate the corresponding fitted effects.
This gives \(\mu\), the grand mean.
Subtract \(\mu\) from a row average to get \(\alpha_i\), and from a column average to get \(\beta_j\).
Subtract \(\mu\), \(\alpha_i\), and \(\beta_j\) from \(\mu_{ij}\) to get \((\alpha\beta)_{ij}\).
The A effects and B effects should each sum to zero, and interaction components should sum to zero within every row and column.
Worked Conversions
Worked Example: Decomposing a Two-by-Two Table
Suppose a hypothetical balanced experiment has the following cell means, measured in points:
| B level 1 | B level 2 | |
|---|---|---|
| A level 1 | 10 | 14 |
| A level 2 | 16 | 22 |
First calculate the grand mean:
The row averages are \(12\) and \(19\), so the A effects are \(12-15.5=-3.5\) points and \(19-15.5=3.5\) points. The column averages are \(13\) and \(18\), giving B effects \(13-15.5=-2.5\) points and \(18-15.5=2.5\) points. Each pair sums to zero.
For the first cell, the interaction component is \(10-15.5-(-3.5)-(-2.5)=0.5\) points. Applying the same calculation to all four cells gives:
The interaction components sum to zero in each row and column. Reconstructing the first cell gives \(15.5-3.5-2.5+0.5=10\) points. For the cell at A level 2 and B level 2, the reconstruction is \(15.5+3.5+2.5+0.5=22\) points. The other two cells likewise reproduce the given means.
Worked Example: Checking Constraints in a Three-by-Two Table
Consider this hypothetical table of cell means, measured in milligrams:
| B level 1 | B level 2 | |
|---|---|---|
| A level 1 | 8 | 10 |
| A level 2 | 12 | 16 |
| A level 3 | 16 | 18 |
The grand mean is \(80/6=13.333\) milligrams. The row averages are \(9\), \(14\), and \(17\), so the A effects are \(-4.333\), \(0.667\), and \(3.667\) milligrams. Their sum is \(0\). The column averages are \(12\) and \(44/3=14.667\), so the B effects are \(-1.333\) and \(1.333\) milligrams; these also sum to \(0\).
The interaction in the first cell is \(8-13.333-(-4.333)-(-1.333)=0.333\) milligrams. Calculating the other cells gives the interaction table:
Every row sums to zero, and each column sums to zero. As a reconstruction check, the fitted mean for A level 2 and B level 2 is \(13.333+0.667+1.333+0.667=16.000\) milligrams, matching the table. Rounding explains any tiny discrepancies that could arise if rounded component values were used in further calculations.
Why the Constraints Give Identifiability
A parameterization is identifiable when distinct allowed parameter values cannot describe the same model means. Here the constraints make the grand mean and effects uniquely recoverable from the cell means. A short derivation verifies this claim and shows why the component formulas work.
In \(\mu_{ij}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}\), the average of the A effects is zero, as is the average of the B effects. The interaction terms also average to zero by the row and column constraints. Therefore the average cell mean equals \(\mu\).
For fixed \(i\), the row average of \(\mu_{ij}\) is \(\mu+\alpha_i\): the B effects average to zero, and the interaction components in that row sum to zero. Subtracting \(\mu\) leaves \(\alpha_i\).
For fixed \(j\), the column average of \(\mu_{ij}\) is \(\mu+\beta_j\), because the A effects and the interaction components in that column sum to zero. Subtracting \(\mu\) leaves \(\beta_j\).
Once \(\mu\), \(\alpha_i\), and \(\beta_j\) are determined, the cell equation forces \((\alpha\beta)_{ij}=\mu_{ij}-\mu-\alpha_i-\beta_j\). There is no remaining choice of components that preserves both the cell means and the constraints.
This argument also explains the role of the balanced layout in these formulas: averaging equally over the other factor’s levels is straightforward because all cells have the same replication. The focus here is the parameterization and its constraints, not a test of whether any component differs from zero.
Worked Example: Seeing the Ambiguity Without a Constraint
Suppose a hypothetical two-by-two set of cell means is generated by \(\mu=10\) points, A effects \((-1,1)\) points, B effects \((-2,2)\) points, and zero interaction. The predicted means are \(7,11,9,13\) points, in row order.
Now change the grand mean to \(13\) points and change the two A components to \((-4,-2)\) points, leaving the B effects and interactions unchanged. The first row still has means \(13-4-2=7\) and \(13-4+2=11\); the second has means \(13-2-2=9\) and \(13-2+2=13\). Thus both sets of parameters describe exactly the same cell means.
The second set is not a valid sum-to-zero effects parameterization: its A components sum to \(-6\) points, rather than zero. This example shows why the cell predictions alone do not identify unconstrained components. The constraints select one decomposition: in the first set, the A effects and B effects each sum to zero, and the grand mean is the average of the four cell means.
Common Mistake and Why This Matters
A frequent mistake is to treat the grand mean and the factor effects as uniquely determined before stating constraints. For example, one might shift a constant from every A effect into the grand mean and assume that the new effects have the same interpretation. The cell means can indeed remain unchanged, but the effect components have changed; without a rule such as sum-to-zero, there is no unique decomposition.
A related error is to assume that an interaction component is simply the cell mean or that the grand mean is one particular cell mean. Neither is correct. The interaction is the remainder after subtracting the grand mean and the two factor effects, while the grand mean is the average across all cells under the balanced, equal-level convention used here.
Check Your Understanding
Use the definitions and constraints in this tutorial to answer the following questions.
- In the cell-means model, what does \(\mu_{ij}\) represent, and what assumptions are made about the errors?
- For a balanced two-factor table, how is \(\alpha_i\) calculated from the cell means?
- What must be true of the interaction components when summed across a row or down a column?
- Why can two different unconstrained collections of components produce the same cell means?
- If the A effects are \(-2\), \(0\), and \(2\) points, do they satisfy the A sum-to-zero constraint? What does that constraint require?