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 response variable 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 two-way ANOVA 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:

2 Replies to “What is a Nested ANOVA? (Definition & Example)”

  1. I am undertaking a meta-analysis of a physical variable by region ie to ascertain if the value of the variable differs by region. The publications I have reviewed each relate to a single region and there are different numbers of publications that relate to the various regions. I have not been able to obtain the raw data, generally only the mean and the sample size for each study. I have used this information to calculate the weighted average of the dependent variable for each region. I am planning to undertake an analysis of variance to investigate the differences between regions. Is this a correct approach?

    1. Hi Ilona…Your approach of using **weighted averages** of the dependent variable for each region is a reasonable starting point for summarizing the data, but there are some statistical considerations when conducting an **Analysis of Variance (ANOVA)** in a **meta-analysis setting** where raw data is unavailable.

      ### **Issues with Standard ANOVA in Meta-Analysis**
      1. **Ignoring Variance Information**:
      – ANOVA assumes that each observation (mean per region) has equal variance, but in your case, different studies have different sample sizes, and their reported means have **different levels of precision**.
      – Studies with larger sample sizes should carry more weight than those with smaller sample sizes.

      2. **Heterogeneity Across Studies**:
      – The studies within each region may vary in methodology, measurement techniques, and population characteristics, introducing **heterogeneity**.
      – A standard ANOVA does not account for such heterogeneity.

      3. **Effect Sizes Instead of Raw Means**:
      – Meta-analysis often compares **effect sizes** rather than raw means. In your case, you only have means and sample sizes but not the standard deviations (SDs), which makes it difficult to compute standardized effect sizes (e.g., Cohen’s d).

      ### **Alternative Approaches**
      Given the limitations of using standard ANOVA, consider the following meta-analytic techniques:

      1. **Random-Effects or Fixed-Effects Meta-Analysis by Region**
      – If you can obtain **standard deviations** (or estimate them using methods like imputation), you can perform a **meta-analysis using a random-effects model**.
      – This accounts for both within-study and between-study variability and provides **better weight adjustment** than a simple weighted average.

      2. **Meta-Analysis of Means Using Inverse-Variance Weighting**
      – Since you have **mean values and sample sizes**, you can compute a **weighted mean per region** using **inverse-variance weighting**:
      \[
      \bar{X}_{region} = \frac{\sum (w_i \cdot \bar{X}_i)}{\sum w_i}
      \]
      where \( w_i = \frac{1}{\text{variance}_i} \), and variance can be approximated as:
      \[
      \frac{\text{SD}^2}{N}
      \]
      (If SD is unavailable, some meta-analytical methods estimate it from similar studies.)

      3. **Meta-Regression (If More Data is Available)**
      – If you can collect more characteristics of studies (e.g., year of publication, population characteristics, measurement methods), **meta-regression** can help model differences between regions while adjusting for covariates.

      ### **Conclusion**
      – **Standard ANOVA is not appropriate** in your case because it does not account for different study weights, heterogeneity, and variance differences.
      – Instead, consider using **meta-analytic techniques**, such as **inverse-variance weighting**, **random-effects models**, or **meta-regression**, depending on data availability.

      If you have access to **sample sizes and means only**, try estimating SDs or finding comparable studies that report SDs to improve your analysis.

Leave a Reply