contr.Tukey | R Documentation |
Returns a matrix of Tukey-type contrasts (all-pairwise)
contr.Tukey(n, names = NULL)
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 |
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.
A matrix with n columns and n(n-1)/2 rows
Andrea Onofri
contr.Tukey(8, LETTERS[1:8])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.