powered by
Construct the contrast matrix to make various comparsions of different treatments.
contrast.matrix(contrast, model.matrix.names)
Matrix which columns correspond to contrasts.
A vector of character strings specifying the various comparisons, which are the expressions constituted by model.matrix.names.
Column names of model (design) matrix.
model_variables <- c("A", "B", "C", "D") contrast <- c("AvsB" = "A-B", "AvsC" = "A-C", 'AvsB.C.D'= "A-(B+C+D)/3") contrast.matrix(contrast, model_variables)
Run the code above in your browser using DataLab