Tutorials › ANOVA › Choosing Between Type II And Type III Tests

Types of Sums of Squares · Tutorial 263 of 595

Choosing Between Type II And Type III Tests

Choose a Type II or Type III test by identifying which model terms it adjusts for and what effect your scientific question actually concerns.

Advanced 11 min read

What You'll Learn

  • State the adjustment rule for Type II and Type III tests in a factorial model
  • Explain why interaction terms complicate the interpretation of main-effect tests
  • Identify the marginal-effect hypothesis tested by a Type III main-effect test under sum-to-zero coding
  • Calculate an adjusted contrast and its partial F statistic in a hypothetical factorial study
  • Choose a test that matches the model structure and scientific question
  • Recognize why a test label alone does not define the hypothesis being tested

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

$$ Y_{ijk} = \mu_{ij} + \varepsilon_{ijk}, \qquad \varepsilon_{ijk} \sim N(0,\sigma^2). $$

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.

Definition: A Type II test tests a model term after adjustment for other terms that do not contain it. A main effect is not adjusted for interactions that contain that main effect. A Type III test tests a model term after adjustment for all the other terms in the specified model, including interactions that contain it. The meaning of a Type III main-effect test in an unbalanced design also depends on how the factorial hypotheses are defined, including the factor coding or marginal-means convention.

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:

$$ F = \frac{3^2}{1.035^2} \approx 8.40. $$

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:

$$ \widehat{\Delta}_A = \frac{(14-10)+(18-20)}{2} = 1 \text{ response unit}. $$

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

$$ \widehat{\operatorname{Var}}(\widehat{\Delta}_A) = \frac{1}{4} \left( \frac{5}{2}+\frac{5}{8}+\frac{5}{8}+\frac{5}{2} \right) = 1.5625. $$

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.

1
Specify the factorial model.
State which main effects and interactions are included. A test’s adjustment rule only makes sense relative to that model.
2
Decide whether interactions belong in the 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.
3
Write the hypothesis in words or as a contrast.
Is it a common additive main effect, an equal-weight marginal difference, or a simple effect at a specified level of another factor?
4
Match the adjustment rule to that hypothesis.
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.
5
Report the hypothesis and model with the result.
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.

Key takeaway: Type II adjusts a term for other terms that do not contain it; Type III adjusts it for all other terms in the model. Choose between them by stating the model and the exact hypothesis first, especially when interactions and unequal cell sizes are present.

Check Your Understanding

For each question, identify the adjustment or interpretation that matters before deciding on a test.

  1. In a model containing \(A\), \(B\), and \(A:B\), which of those terms is not adjusted for in a Type II test of \(A\)?
  2. Under sum-to-zero coding, what kind of marginal comparison does a Type III test of \(A\) represent in a two-factor model?
  3. Why can a non-significant marginal main-effect test coexist with an interaction that indicates different \(A\) effects across levels of \(B\)?
  4. A study has unequal cell sizes and an important \(A:B\) interaction. What should be stated before selecting a main-effect test?
  5. Why is it not sound practice to choose between Type II and Type III by selecting whichever gives the smaller p-value?
Clinical Biostats