[R] limma contrast matrix

Belmont, John W jbelmont at bcm.edu
Thu Aug 4 14:53:17 CEST 2011


I am trying to correct for the effect of 2 covariates in a gene expression data set.


design<-model.matrix(~0 + Factor + cov1 + cov2)


QUESTION:
How to set up the contrast matrix? 

The usual commands

fit <- lmFit(selDataMatrix, design) 
cont.matrix <- makeContrasts(FacCont=Group1-Group2, levels=design)
fit2 <- contrasts.fit(fit, cont.matrix)

does not work because the original design matrix includes the covariates.

I think I don't really understand how the contrast matrix works.


John W. Belmont, M.D.,Ph.D.
Professor
Department of Molecular and Human Genetics
Baylor College of Medicine
1100 Bates, Room 8070
Houston, TX 77030
713-798-4634
fax: 713-798-7187



More information about the R-help mailing list