Generate all pairwise contrasts for using in a post-hoc test, e.g. ScheffeTest.

Contrasts(levs)

Arguments

levs

the levels to be used

Value

A matrix with all possible pairwise contrasts, that can be built with the given levels.

Author

Andri Signorell <andri@signorell.net>

See also

Examples

Contrasts(LETTERS[1:5])
#>   B-A C-A D-A E-A C-B D-B E-B D-C E-C E-D
#> A  -1  -1  -1  -1   0   0   0   0   0   0
#> B   1   0   0   0  -1  -1  -1   0   0   0
#> C   0   1   0   0   1   0   0  -1  -1   0
#> D   0   0   1   0   0   1   0   1   0  -1
#> E   0   0   0   1   0   0   1   0   1   1

#   B-A C-A D-A E-A C-B D-B E-B D-C E-C E-D
# A  -1  -1  -1  -1   0   0   0   0   0   0
# B   1   0   0   0  -1  -1  -1   0   0   0
# C   0   1   0   0   1   0   0  -1  -1   0
# D   0   0   1   0   0   1   0   1   0  -1
# E   0   0   0   1   0   0   1   0   1   1