Successive Differences contrast coding
A coding for unordered factors based on successive differences.
contr.sdif(n, contrasts = TRUE)
- The number of levels required.
- Should there be
n - 1columns orthogonal to the mean (the default) or
ncolumns spanning the space.
The contrast coefficients are chosen so that the coded coefficients in a one-way layout are the differences between the means of the second and first levels, the third and second levels, and so on.
TRUE, a matrix with
n - 1columns, and the
nidentity matrix if
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition, Springer.