| contrMat {multcomp} | R Documentation |
Contrast Matrices
Description
Computes contrast matrices for several multiple comparison procedures.
Usage
contrMat(n, type = c("Dunnett", "Tukey", "Sequen", "AVE",
"Changepoint", "Williams", "Marcus",
"McDermott", "UmbrellaWilliams", "GrandMean"),
base = 1)
Arguments
n |
a (possibly named) vector of sample sizes for each group. |
type |
type of contrast. |
base |
an integer specifying which group is considered the baseline group for Dunnett contrasts. |
Details
Computes the requested matrix of contrasts for comparisons of mean levels. The general concept and specific choices are discussed by Hothorn, Bretz, and Westfall (2008) and Bretz, Hothorn, and Westfall (2010).
Value
The matrix of contrasts with appropriate row names is returned.
References
Bretz F., Hothorn T., Westfall P. (2010). Multiple Comparisons Using R. Chapman & Hall/CRC Press, Boca Raton, Florida, USA.
Hothorn T., Bretz F., Westfall P. (2008). “Simultaneous Inference in General Parametric Models.” Biometrical Journal, 50(3), 346–363. doi:10.1002/bimj.200810425.
Examples
n <- c(10,20,30,40)
names(n) <- paste("group", 1:4, sep="")
contrMat(n) # Dunnett is default
contrMat(n, base = 2) # use second level as baseline
contrMat(n, type = "Tukey")
contrMat(n, type = "Sequen")
contrMat(n, type = "AVE")
contrMat(n, type = "Changepoint")
contrMat(n, type = "Williams")
contrMat(n, type = "Marcus")
contrMat(n, type = "McDermott")
### Umbrella-protected Williams contrasts, i.e. a sequence of
### Williams-type contrasts with groups of higher order
### stepwise omitted
contrMat(n, type = "UmbrellaWilliams")
### comparison of each group with grand mean of all groups
contrMat(n, type = "GrandMean")