contr.Tukey: Pairwise contrast matrix

View source: R/pairComp.R

contr.TukeyR 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])

statforbiology documentation built on Oct. 30, 2024, 9:13 a.m.