What is a Nested ANOVA? (Definition & Example)

A Nested ANOVA (Analysis of Variance) is a statistical method used to analyze the differences between two or more groups within a larger group. It involves partitioning the overall variability into smaller components, allowing for the examination of the effects of multiple factors on a dependent variable. In this type of ANOVA, the levels of one factor are nested within the levels of another factor, creating a hierarchical structure. This allows for the evaluation of both main effects and interactions between factors. An example of a nested ANOVA would be studying the effects of different teaching methods (nested within different schools) on student test scores (dependent variable). This statistical tool is commonly used in research and can provide valuable insights into the relationships between various factors and their impact on a specific outcome.

What is a Nested ANOVA? (Definition & Example)


A nested ANOVA is a type of ANOVA (“analysis of variance”) in which at least one factor is nested inside another factor.

Note: Sometimes a nested ANOVA is called a “hierarchical ANOVA.” These two terms are often used interchangeably.

For example, suppose we would like to know if three different fertilizers produce different levels of plant growth.

To test this, we have three different technicians sprinkle fertilizer A on four plants each, another three technicians sprinkle fertilizer B on four plants each, and another three technicians sprinkle fertilizer C on four plants each.

In this scenario, the is plant growth and the two factors are technician and fertilizer. It turns out that technician is nested within fertilizer:

Example of nested ANOVA

Here’s what the raw data would look like:

Example of nested ANOVA dataset

In this scenario, a nested ANOVA can test for two things:

  • Is plant growth equal across each level of factor 1 (fertilizer)?
  • Is plant growth equal across each level of factor 2 (technician)?

When we perform a nested ANOVA (using statistical software like R, Excel, SPSS, etc.) , the output will be in the following format:

Nested ANOVA output

Here’s how to interpret the output:

  • Source: The source of the variance
  • Sum of Squares: The sum of the squared deviations
  • df: The degrees of freedom
  • Mean Square: The mean square, calculatead as Sum of Squares / df
  • F-Value: The F-value, calculated as Mean Square / Mean Square Residuals
  • p-value: The p-value that corresponds to the F-value

We can look at the p-value column to determine whether or not each factor has a statistically significant effect on plant growth.

From the table above, we can see that fertilizer has a statistically significant effect on plant growth (p-value < .05) but technician does not (p-value = 0.211).

This tells us that if we’d like to increase plant growth, we should focus on the fertilizer being used rather than the individual technician who is sprinkling the fertilizer.

Notes

Here are a few notes to keep in mind about nested ANOVA’s:

1. Nested ANOVA’s can have more than two factors.

In the previous example the nested ANOVA had two factors, one nested inside the other. However, a nested ANOVA could have more than two factors nested inside each other.

2. Nested ANOVA’s are different than two-way ANOVA’s.

In a nested ANOVA, at least one factor is nested inside another factor. This is different from a in which there are also two factors but neither factor is nested inside the other.

For example, in the previous scenario suppose each technician sprinkled each type of fertilizer. In this case, we could perform a two-way ANOVA because every possible combination of technique and fertilizer occurred in the dataset.

How to Perform a Nested ANOVA in Practice

The following tutorials explain how to perform a nested ANOVA in Excel and R:

x