For balanced classifications and for unbalanced nested classifications, we give a simple rule which establishes a one-to-one correspondence between numbers of degrees of freedom and projection operators in the analysis of variance. The rule enables us to determine explicitly the matrix representations of appropriate sums of squares.