Checking those all-important ANOVA residual diagnostic plots

To ensure the validity of an analysis of variance (ANOVA) some important assumptions are made, including that the residuals are Normally distributed and with constant variance. In this blog, we discuss how to assess whether these two assumptions appear reasonable using some common and simple residual diagnostic plots.

Ensuring homogeneous variance

For an ANOVA to be valid, it is assumed that the residual variance is homogeneous (i.e., constant) across all experimental units. For example, the variability of the residuals should be the same for both high and low values of the response variable.

Homogeneity of variance can be easily assessed by plotting the residuals against the fitted values. If the variance is constant, the residuals should lie within a uniform horizontal band. That is, there shouldn’t be any pattern evident in the plot.

Let’s look at two examples:

alt text

Interpreting patterns: Variance insights

The plot for Example A is consistent with what we’d expect from constant residual variance. That is, there is no pattern evident in the plot, and the residuals fall within a more-or-less uniform band across the range of fitted values. From such a plot, the assumption of constant variance is supported.

Conversely, in Example B, there is a clear pattern in the residuals. In particular, we see that the variation (or spread) of the residuals increases as the fitted values get larger. This will have some bad consequences on the results generated by ANOVA, causing incorrect conclusions to be drawn. For instance, in this case of Example B, the standard errors of means will be over-estimated (i.e., too large) for low means, and under-estimated (i.e., too small) for high means. Likewise, the standard errors of differences between treatment means will be over-estimated when comparing two lower means, and under-estimated when comparing two larger means.

Remedies for variance issues

If a plot of residuals against fitted values indicates non-homogeneity of variances, a transformation of the data can be considered. For example, a logarithm transformation will often stabilise variance that increases with the response.

However, one situation where unequal variances can occur, but where a transformation may not help, is when the data have been collected in different years or at different locations. It is then important to check that the variances within the years (or at each location) are the same. If they are not, a weighted ANOVA will be required, where the data from each year are weighted by the reciprocal of the variance for that year.

Finally, as non-constant variance is often also associated with non-Normal data, a generalized linear model (GLM) might be more appropriate.

Assessing the Normality of residuals

ANOVA assumes that the residuals are Normally distributed, and this can be assessed graphically in a couple of different ways.

Firstly, the residuals can be plotted as a histogram. This should look approximately like a Normal distribution. That is, the histogram should be relatively symmetrical (i.e., non-skewed) and roughly bell-shaped.

The histograms below are from ANOVAs of artificial data generated from:

1. a Normal distribution

and

2. a non-Normal distribution (i.e. the exponential)

alt text

Comparing data distributions

Notice that the histogram from the ANOVA of Normal data is approximately symmetrical and bell-shaped. Conversely, the histogram from the ANOVA of non-Normal data is clearly skewed, with a long right-tail.

The Normal plot 1 (also known as a Q-Q plot) can also be used to graphically assess the assumption of Normality. Here, the ordered residuals are plotted against the quantiles of the standard Normal distribution. If the residuals have a perfect Normal distribution, then they will align exactly on a diagonal straight line.

Shown below are the Normal plots from the ANOVAs of the artificial Normal and non-Normal data used above. Note that compared to the plot from the non-Normal data, the plot for the Normal data follows a reasonably straight line.

alt text

As for non-constant variance, non-Normality may be addressed via transformation of the response variable, or by moving to a different modelling framework that caters for non-Normal distributions (e.g., GLMs). In general, though, ANOVA is fairly robust to departures from Normality, thus the repercussions of non-Normality aren’t as severe as non-constant variance.

Sizing up sample influence

As demonstrated above, residual diagnostic plots can be used to help verify the important assumptions of Normality and constant variance. However, the utility of these graphical tools does depend on the sample size. If large numbers of residuals are plotted, then departures from the assumptions are easier to identify. However, if the data set is small (e.g., < 20 residuals), then true departures from the assumptions are harder to identify, as features evident in the graphs might simply be an artifact of the small sample.

And a final word…

Always remember to assess the validity of your model assumptions before attempting to make any inference from the analysis. If the model assumptions are violated, any conclusions you draw are in jeopardy.


1 Note, an alternative to the Normal plot is the half-Normal plot. Here, the ordered absolute values of the residuals are plotted against the quantiles of the standard Normal distribution. As for the Normal plot, if the residuals have a Normal distribution, this plot should follow a straight line. ↩

Picture of Dr. Vanessa Cave
Dr. Vanessa Cave
Dr. Vanessa Cave is an applied statistician interested in the application of statistics to the biosciences, in particular agriculture and ecology, and is a developer of the Genstat statistical software package. She has over 15 years of experience collaborating with scientists, using statistics to solve real-world problems. Vanessa provides expertise on experiment and survey design, data collection and management, statistical analysis, and the interpretation of statistical findings. Her interests include statistical consultancy, mixed models, multivariate methods, statistical ecology, statistical graphics and data visualisation, and the statistical challenges related to digital agriculture. Vanessa is a past President of both the Australasian Region of the International Biometric Society and the New Zealand Statistical Association, on the Editorial Board of The New Zealand Veterinary Journal and an honorary academic at the University of Auckland. She has a PhD in statistics from the University of St Andrew.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Related articles

How much of the variation in your field trial comes from the treatments, and how much comes from...
What should you do when count data are more variable than your model expects? Vanessa Cave and David...
Precision breeding can deliver scientifically impressive traits, but practical value depends on more than technical success. Owen McIntosh...