Learn R Programming

EMA (version 1.4.7)

makeAllContrasts: Create all pairwise contrasts

Description

Create the matrix of all pairwise contrasts between parameters for the test.LC function

Usage

makeAllContrasts(X, annot)

Arguments

X

the design matrix

annot

the annotation table of the individuals with the columns corresponding to the model variables

Details

This function create a contrasts matrix that can be used with the test.LC function. All pairwise comparisons for each variable stratified into all other variables are returned.

Examples

Run this code
# NOT RUN {
data(marty)

##Class label 0/1
marty.type.num <- ifelse(marty.type.cl=="Her2+",0,1)

#Annotation of the grade of tumor
grade <- factor(sample(c(1:3),23,rep=TRUE),labels=c("I","II","III"))

annot <- data.frame(type=marty.type.num, grade=grade)
rownames(annot) <- colnames(marty)

marty.lm <- lm(marty[1,]~ annot$grade * annot$type)
X <- model.matrix(marty.lm)

LC <- makeAllContrasts(X, annot)

# }

Run the code above in your browser using DataLab