The number of alternative sets of orthogonal contrasts refers to the number of different statistical models available to describe the orthogonal and balanced partitioning of variation between i levels of a categorical factor. For eight and more levels, the number of sets increases supra-exponentially with the number of factor levels (sequence A165438 in OEIS). An ANOVA factor with 3 levels has 1 set of orthogonal contrasts; a factor with 4 levels has 3 contrast sets. A factor with i = 5, 6, or 7 levels has ni contrast sets, given by:

A factor with i > 7 levels has ni contrast sets, given by:

where

 Levels Sets 3 1 4 3 5 4 6 8 7 15 8 34 9 69 10 152 11 332 12 751 13 1698 14 3905 15 9020 16 21051 17 49356 18 116505 19 276217 20 658091 21 1573835 22 3778152 23 9098915 24 21980209 25 53241777 26 129294912 27 314714273 28 767700735 29 1876437054 30 4595005570

For example, a factor A with i = 6 levels has n6 = 8 alternative sets of orthogonal contrasts, each with i - 1 = 5 contrasts. The corresponding alternative general linear models describing contrasts B, C, D, E, F are:

1. Y = B + C(B) + D(C B) + E(B) + F(E B) + ε
2. Y = B + C(B) + D(B) + E(D B) + F(E D B) + ε

3. Y = B + C(B) + D(B) + E(D B) + F(D B) + ε

4. Y = B + C(B) + D(B) + E(B) + F(B) + ε

5. Y = B + C(B) + D(C B) + E(C B) + F(E C B) + ε

6. Y = B + C(B) + D(C B) + E(D C B) + F(E D C B) + ε

7. Y = B + C(B) + D(C B) + E(D C B) + F(D C B) + ε

8. Y = B + C(B) + D(C B) + E(C B) + F(C B) + ε

where Y is the response and ε is the residual error from the main effect model Y = A + ε.

Program Contrasts.exe identifies the coefficients for every set of balanced orthogonal contrasts on a factor with any number of levels up to a maximum of 12. For a chosen set or range of sets, it stores contrast coefficients in a text file (Contrasts.txt) for any specified number of replicates, and will identify the unique GLM model for analysing the set with sequential SS, after each data line has been tagged with the response value for the replicate.

Doncaster, C. P. & Davey, A. J. H. (2007) Analysis of Variance and Covariance: How to Choose and Construct Models for the Life Sciences. Cambridge: Cambridge University Press.

http://www.southampton.ac.uk/~cpd/anovas/datasets/