[BioC] mulitfactorial analysis, adjusting for quantitative covariates
James W. MacDonald
jmacdon at uw.edu
Mon Dec 2 16:38:10 CET 2013
On Monday, December 02, 2013 4:12:20 AM, Ingrid Dahlman [guest] wrote:
> I would like to use Limma to compare gene expression between two treatment groups (PO vs C). In this analysis I need to adjust for differences in a quantitative covariate (age) between samples. Is the following setup appropriate for this analysis? Do I accurately adjust for age in the final analysis?
> -- output of sessionInfo():
> GROUP <- factor(target$GROUP, levels=c("C","PO"))
> AGE <- factor(target$AGE)
I don't think this is what you want to do. A factor is by definition
something that is unordered and not quantitative. I would think instead
you want to fit age as a continuous covariate. Something like
design <- model.matrix(~ 0 + GROUP + AGE, target)
colnames(design) <- gsub("target", "", colnames(design))
Should get you what you want.
> design <- model.matrix(~0+GROUP+AGE)
> colnames(design) <- c("C","PO")
> fit <- lmFit(eset,design)
> cont.matrix <- makeContrasts(CvsPO=C-PO,levels=design)
> fit2 <- contrasts.fit(fit, cont.matrix)
> fit2 <- eBayes(fit2)
> topTable(fit2, n=100, coef="CvsPO", adjust="BH")
> Sent via the guest posting facility at bioconductor.org.
> Bioconductor mailing list
> Bioconductor at r-project.org
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
James W. MacDonald, M.S.
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099
More information about the Bioconductor