I thought I understood the degree of freedom after reading Wikipedia explanation, but came across the sum of squares for contrasts $\{c_i\}$ $$SS_C = \frac{(\sum_i {c_i \bar{y_i}})^2}{\sum_i c_i^2 /n_i}$$ which the textbook said it has one degree of freedom. Why is this so? I don't think the Wikipedia explanation works here, but I don't know why.

  • 2
    $\begingroup$ If you have three levels of a factor, then DF for the factor is 3-1 = 2. There can be two orthogonal contrasts on factor levels, each with one DF. For example $c(-1,0,1) \perp c(-1, 2, -1).$ Orthogonal because $\sum_{j} c_{1j}c_{2j} = 0.$ $\endgroup$
    – BruceET
    Jan 8, 2021 at 19:17

1 Answer 1


While using contrasts we make the following comparisons:

  1. Effects of two different treatment groups.
  2. Effect of one treatment group with the effect of a set of treatment groups.
  3. Effect of a set of treatment groups with the effect of another set of treatment groups

In each case, we tend to bundle the treatment effects into two groups, g=2, hence the degrees of freedom in case of contrasts is always, g-1 = 2-1 = 1.

For example, comparison of diet A vs diet B, comparison of diet A vs combined effect of diet B and diet C, etc.

In simpler words, if you have two groups, you only have the freedom to select one of them, the other one comes by default.

You could also refer to this video at 11:50 - https://www.youtube.com/watch?v=c9krZdM635Y&t=1052s

  • $\begingroup$ I think the focus of the question is captured by the comment by BruceET (2021 01 08). If we have a one-way anova with three groups for the independent variable, the df for this independent variable is 2. But we can construct single-degree-of-freedom contrasts, for example looking for a linear trend across these groups, (-1, 0, 1). $\endgroup$ Aug 29, 2022 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.