Learn R Programming

FLASHMM (version 1.2.0)

contrast.matrix: Construct Contrast Matrix

Description

Construct the contrast matrix to make various comparsions of different treatments.

Usage

contrast.matrix(contrast, model.matrix.names)

Value

Matrix which columns correspond to contrasts.

Arguments

contrast

A vector of character strings specifying the various comparisons, which are the expressions constituted by model.matrix.names.

model.matrix.names

Column names of model (design) matrix.

Examples

Run this code
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