This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/contrast.html
Contrast {base}R Documentation

Contrast Matrices

Usage

contr.helmert(n, contrasts=TRUE)
contr.poly(n, contrasts=TRUE)
contr.sum(n, contrasts=TRUE)
contr.treatment(n, contrasts=TRUE)

Value

A matrix with n rows and k columns, with k=n-1 if contrasts is TRUE and k=n if contrasts is FALSE.

These functions are used for creating contrast matrices for use in fitting analysis of variance and regression models. The columns of the resulting matrices contain contrasts which can be used for coding a factor with n levels. The returned value contains the computed contrasts. If the argument contrasts is FALSE then an additional column of ones is prepended to the matrix.

See Also

contrasts, glm, lm.


[Package base version 0.60 ]