[BioC] mulitfactorial analysis, adjusting for quantitative covariates
James W. MacDonald
jmacdon at uw.edu
Mon Dec 2 16:38:10 CET 2013
Hi Ingrid,
On Monday, December 02, 2013 4:12:20 AM, Ingrid Dahlman [guest] wrote:
>
> Hi!
> 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?
> Ingrid
>
> -- output of sessionInfo():
>
> eset<-readExpressionSet("eset.txt","target.txt",header=TRUE)
> 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.
Best,
Jim
> 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
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
--
James W. MacDonald, M.S.
Biostatistician
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099
More information about the Bioconductor
mailing list