contr.Tukey {statforbiology} | R Documentation |
Pairwise contrast matrix
Description
Returns a matrix of Tukey-type contrasts (all-pairwise)
Usage
contr.Tukey(n, names = NULL)
Arguments
n |
an integer: the number of levels, corresponding to the number of columns in the output matrix |
names |
a vector of names with same length as n |
Details
This functions is used for creating contrast matrices for use with glht or other methods for fitting linear contrasts. The rows of the resulting matrices contain the coefficients of contrasts relating to a factor with n levels. The names of the levels can be optionally given with the argument 'names', other wise they default to the numbers from 1 to n.
Value
A matrix with n columns and n(n-1)/2 rows
Author(s)
Andrea Onofri
Examples
contr.Tukey(8, LETTERS[1:8])
[Package statforbiology version 0.9.9 Index]