11Contrasts

One of the hardest things about learning to do statistics is knowing how to interpret the output produced by the model that you have fitted to data. The reason why the output is hard to understand is that it is based on contrasts, and the idea of contrasts may be unfamiliar to you.

Contrasts are the essence of hypothesis testing and model simplification. They are used to compare means or groups of means with other means or groups of means, in what are known as single degree of freedom comparisons. There are two sorts of contrasts we might want to carry out:

  • contrasts we had planned to carry out at the experimental design stage (these are referred to as a priori contrasts)
  • contrasts that look interesting after we have seen the results (these are referred to as a posteriori contrasts)

Some people are very snooty about a posteriori contrasts, on the grounds that they were unplanned. You are not supposed to decide what comparisons to make after you have seen the analysis, but scientists do this all the time. The key point is that you should only do contrasts after the ANOVA has established that there really are significant differences to be investigated. It is bad practice to carry out tests to compare the largest mean with the smallest mean, if the ANOVA fails to reject the null hypothesis (tempting though this may be).

There are two important points to understand about contrasts:

  • there is a huge number of possible contrasts
  • there are only k − 1 orthogonal contrasts ...

Get Statistics: An Introduction Using R, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.