Why the Choice Matters
In a balanced factorial design, several sums-of-squares procedures can produce the same tests. With unequal cell sizes, they may produce different results because they adjust for different model terms and can test different hypotheses. Choosing between Type II and Type III tests is therefore not simply a software preference: the choice should follow from the factorial model and the scientific question.
The central distinction is whether a term is tested after adjusting for interactions that contain it. A Type II test does not adjust a main effect for interactions involving that effect. A Type III test does. When an interaction is important, these choices can correspond to quite different claims about a main effect.
The Model and the Two Adjustment Rules
Consider a fixed-effects two-factor model with factors \(A\) and \(B\), and a quantitative response \(Y\). In a complete factorial design, its cell-means form is
Here \(\mu_{ij}\) is the population mean response in the cell formed by level \(i\) of \(A\) and level \(j\) of \(B\); \(k\) indexes observations within that cell. The standard model assumptions are independent errors, a common error variance \(\sigma^2\) across cells, and normally distributed errors. In the equivalent effects form, the model includes main effects for \(A\) and \(B\), and an \(A:B\) interaction. Each test also requires that the hypothesis being tested is estimable from the observed design.
For example, in the model \(A+B+A:B\), the Type II test of \(A\) adjusts for \(B\), but not for \(A:B\). The Type III test of \(A\) adjusts for both \(B\) and \(A:B\). The first is not a test of an \(A\) effect conditional on the interaction; the second is.
With sum-to-zero coding, a Type III main-effect test for \(A\) in a two-factor model tests whether the means for the levels of \(A\), averaged equally over the levels of \(B\), are equal. This is an equal-weight marginal comparison, not an average weighted according to the observed number of participants in each cell. Other coding choices can define a different hypothesis, so the test’s label alone is not enough to identify what was tested.
Why Interactions Change the Question
When an \(A:B\) interaction is present, the difference between two levels of \(A\) can vary across levels of \(B\). A single main-effect summary then needs a clear definition: it might be an equal-weight average of the differences across \(B\), or the question might concern the difference at one particular level of \(B\). Those are distinct scientific questions.
A Type III test under sum-to-zero coding can answer the equal-weight average question. It does not establish that the \(A\) difference is the same at every level of \(B\). A Type II test, which does not adjust the \(A\) test for \(A:B\), does not answer the same conditional question as a Type III test in the full interaction model. If the interaction is important, tests of simple effects—comparisons of \(A\) at specified levels of \(B\), or vice versa—may align more closely with the research question.
This does not mean an interaction automatically makes every main-effect summary useless. It means the main effect must be described as the particular average or comparison being tested, and interpreted alongside the interaction. A statistically significant interaction is evidence that the pattern of differences varies; it does not, by itself, say which individual cell comparisons differ.
Worked Examples
Worked Example: An Additive Model With Unequal Cell Sizes
Suppose a hypothetical experiment compares two levels of \(A\) and two levels of \(B\). Each cell has a positive number of observations, and the four sample means are as follows. The cell sizes are unequal, but the mean difference between the two \(A\) levels is 3 response units at each level of \(B\): \(13-10=3\) at \(B_1\) and \(17-14=3\) at \(B_2\). Assume independent observations, approximately normal residuals, and a common within-cell variance. A model check gives a pooled residual sum of squares of 120 response-units squared for the additive model, with 21 residual degrees of freedom.
For illustration, we assume the additive model—main effects for \(A\) and \(B\), but no \(A:B\) interaction. Equal observed differences alone do not establish that the population interaction is absent, so this model choice would also need support from the scientific context and assumptions. Once that model is specified, the Type II and Type III tests of \(A\) adjust for \(B\) and test the same \(A\) term. The Type III test has no interaction term to adjust for.
For a concrete calculation, suppose the model’s adjusted estimate of the \(A\) difference is 3 response units and its standard error is 1.035 response units. The partial \(F\) statistic for this one-degree-of-freedom term is the squared estimate divided by its estimated variance:
The residual mean square is \(120/21 \approx 5.714\) response-units squared, and the corresponding test is \(F(1,21)=8.40\), with a p-value of approximately 0.0086. At \(\alpha=0.05\), this is evidence of a difference between the \(A\) levels under the additive model. This conclusion concerns the model’s adjusted \(A\) effect; it does not claim that the factors cause the response unless the study design supports a causal interpretation.
Worked Example: An Interaction Makes the Average Explicit
In a second hypothetical, balanced \(2 \times 2\) experiment, the cell means are 10 and 14 response units at \(B_1\), and 20 and 18 response units at \(B_2\), where each pair lists \(A_1\) then \(A_2\). There are five independent observations per cell. Suppose the full interaction model has residual sum of squares 80 response-units squared, so the residual degrees of freedom are \(20-4=16\) and the residual mean square is \(80/16=5\) response-units squared. Assume the residual checks support the normal-error and common-variance assumptions.
The \(A_2-A_1\) differences are \(14-10=4\) at \(B_1\) and \(18-20=-2\) at \(B_2\). They are not the same, indicating that the interaction matters to the interpretation. Under sum-to-zero coding, the Type III main-effect contrast is the equal-weight average:
Each cell mean has estimated variance \(5/5=1\). The average contrast gives each of the four cell means a coefficient with magnitude \(1/2\), so its estimated variance is \(4(1/2)^2(1)=1\). The one-degree-of-freedom partial test is therefore \(F=1^2/1=1.00\), or \(F(1,16)=1.00\), with p-value approximately 0.332. This test does not provide evidence that the equal-weight average \(A\) difference is nonzero at \(\alpha=0.05\).
That average does not describe the differences at each level of \(B\). The interaction contrast is the difference between those differences: \(4-(-2)=6\) response units. Its estimated variance is \(4(5/5)=4\), so \(F=6^2/4=9.00\), or \(F(1,16)=9.00\), with p-value approximately 0.008479. The interaction test indicates that the \(A\) difference varies across \(B\). Reporting only the non-significant Type III main-effect test would hide this important feature of the pattern.
Worked Example: An Unequal-Cell Type III Average
Now use the same hypothetical cell means as in the preceding example, but suppose the cell sizes are 2, 8, 8, and 2, respectively, in the order \(A_1B_1\), \(A_2B_1\), \(A_1B_2\), \(A_2B_2\). Suppose the full interaction model has residual sum of squares 80 response-units squared. There are \(20-4=16\) residual degrees of freedom, giving \(MSE=5\) response-units squared. Assume observations are independent and residual diagnostics do not indicate serious violations of normality or equal variance.
The equal-weight Type III marginal contrast remains \(\widehat{\Delta}_A=(4+(-2))/2=1\) response unit. But its precision differs from the balanced example because the cell sizes differ. Each cell mean has estimated variance \(MSE/n_{ij}\). The contrast uses coefficients with magnitude \(1/2\) for all four means, so
The partial statistic is \(F=1^2/1.5625=0.640\), with \(F(1,16)=0.640\) and p-value approximately 0.435. Thus the data provide little evidence against the null hypothesis that the equal-weight marginal \(A\) difference is zero. The estimate and null hypothesis have the same equal-weight interpretation as before, but unequal precision changes the test statistic.
The example also shows why a test should be chosen by its target, not by which result is more significant. If the scientific question concerns the equal-weight average across \(B\), specify that contrast and use a procedure that tests it. If it concerns the \(A\) difference specifically at \(B_1\) or \(B_2\), test that simple effect instead. Neither result alone answers every possible question about \(A\).
A Practical Selection Rule
A useful decision process starts with the model and the intended hypothesis, not the software menu. The following steps make the choice explicit.
State which main effects and interactions are included. A test’s adjustment rule only makes sense relative to that model.
Use subject-matter knowledge and the study’s purpose as well as the observed pattern. Do not remove an important interaction solely to obtain a simpler main-effect test.
Is it a common additive main effect, an equal-weight marginal difference, or a simple effect at a specified level of another factor?
For an additive model, Type II is commonly used to test each main effect adjusted for the other main effects. For a specified full-model marginal effect adjusted for interactions, Type III may be appropriate when its coding defines the intended contrast.
State the tested effect, the interaction structure, the sums-of-squares type, the contrast or weighting convention, and the test statistic with its degrees of freedom.
These are recommendations, not automatic rules. Type II is not universally preferable whenever a test is called a main effect, and Type III is not a general correction for imbalance. In either case, the hypothesis must be appropriate and estimable, the model assumptions must be reasonable, and the adjustment must match the question.
Common Mistake: Choosing by the P-Value
A common mistake is to run both procedures and select whichever gives the smaller p-value, or to assume that Type III is always the “fully adjusted” and therefore correct answer. That reasoning treats different tests as if they were interchangeable versions of one hypothesis. In an unbalanced factorial model with interactions, they may instead test different effects or averages.
The correction is to define the scientific hypothesis first. For example, state whether the target is an equal-weight average of \(A\) differences across \(B\), a difference at a particular \(B\) level, or a common additive effect under a no-interaction model. Then select a model and test that answer the stated question. If an interaction is relevant, show its pattern and consider simple effects; do not let one main-effect p-value stand in for the full factorial interpretation.
Check Your Understanding
For each question, identify the adjustment or interpretation that matters before deciding on a test.
- In a model containing \(A\), \(B\), and \(A:B\), which of those terms is not adjusted for in a Type II test of \(A\)?
- Under sum-to-zero coding, what kind of marginal comparison does a Type III test of \(A\) represent in a two-factor model?
- Why can a non-significant marginal main-effect test coexist with an interaction that indicates different \(A\) effects across levels of \(B\)?
- A study has unequal cell sizes and an important \(A:B\) interaction. What should be stated before selecting a main-effect test?
- Why is it not sound practice to choose between Type II and Type III by selecting whichever gives the smaller p-value?