contrMat {multcomp}R Documentation

Contrast Matrices

Description

Computes contrast matrices for several multiple comparision procedures.

Usage

contrMat(n, type=c("Dunnett", "Tukey", "Sequen", "AVE", 
                   "Changepoint", "Williams", "Marcus", 
                   "McDermott", "Tetrade"), nlevel = NULL, base = 1)
contr.Dunnett(n, base = 1, contrasts=TRUE)

Arguments

n a (possibly named) vector of sample sizes for each group or a vector of factor levels.
type type of contrast.
nlevel number of levels of two factors (for type="Tetrade" only).
contrasts a logical indicating whether contrasts should be computed.
base an integer specifying which group is considered the baseline group for Dunnett contrasts. Ignored if contrasts is FALSE.

Details

Computes the requested matrix of contrasts.

Value

The matrix of contrasts with appropriate rownames is returned.

Author(s)

Frank Bretz <bretz@ifgb.uni-hannover.de> and
Torsten Hothorn <Torsten.Hothorn@rzmail.uni-erlangen.de>

References

Frank Bretz, Alan Genz and Ludwig A. Hothorn (2001), On the numerical availability of multiple comparison procedures. Biometrical Journal, 43(5), 645–656.

Examples

 n <- c(10,20,30,40)
 a <- 2
 b <- 3
 names(n) <- paste("group", 1:4, sep="")
 contrMat(n)    # Dunnett is default
 contrMat(n, base=2)    # use second level as baseline
 contr.Dunnett(names(n))  # it Moore-Penrose Inverse
 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")
 contrMat(n, type="Tetrade", nlevel=c(a,b))

[Package multcomp version 0.4-8 Index]