contrMat {multcomp} | R Documentation |
Computes contrast matrices for several multiple comparison procedures.
contrMat(n, type=c("Dunnett", "Tukey", "Sequen", "AVE", "Changepoint", "Williams", "Marcus", "McDermott"), base = 1)
n |
a (possibly named) vector of sample sizes for each group or a vector of factor levels. |
type |
type of contrast. |
base |
an integer specifying which group is considered the baseline group for Dunnett contrasts. |
Computes the requested matrix of contrasts for comparisons of mean levels.
The matrix of contrasts with appropriate row names is returned.
Frank Bretz, Alan Genz and Ludwig A. Hothorn (2001), On the numerical availability of multiple comparison procedures. Biometrical Journal, 43(5), 645–656.
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")