dContrast: Function to help build the contrast matrix

Description Usage Arguments Value Note Examples

Description

dContrast is used to help build the contrast matrix

Usage

1
2
3
4
dContrast(
level_sorted,
contrast.type = c("average", "zero", "sequential", "pairwise")
)

Arguments

level_sorted

a vector of levels (usually sorted) which are contrated to each other

contrast.type

the type of the contrast. It can be one of either 'average' for the contrast against the average of all levels, 'zero' for the contrast against the zero, 'sequential' for the contrast in a sequential order (it requires the levels being sorted properly), or 'pairwise' for the pairwise contrast.

Value

a list with following components:

Note

none

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
level_sorted <- c("L1","L2","L3","L4")

# the contrast against the average of all levels
contrasts <- dContrast(level_sorted, contrast.type="average")

# the contrast against the zero
contrasts <- dContrast(level_sorted, contrast.type="zero")

# the contrast in a sequential order
contrasts <- dContrast(level_sorted, contrast.type="sequential")

# the pairwise contrast
contrasts <- dContrast(level_sorted, contrast.type="pairwise")

hfang-bristol/dnet documentation built on Feb. 23, 2020, 2:06 p.m.