Question: Limma Model Design
0
2.1 years ago by
Newcastle University
Sarah Nesbitt0 wrote:

Hi everyone,

I've been working with limma but I'm a bit confused about the design of the model matrix which I'm using to determine differential methylation between cases and controls whilst controlling for other covariates, mostly whether I need an intercept?  I've been using:

dm <- (model.matrix(~1 + Status + Gender + Age + Batch,data=pData(dat))) fit1 <- lmFit(exprs(dat),dm, method="ls") fit2 <- eBayes(fit1) tt <- topTable(fit2,coef=2,genelist=fData(dat)[,c('SYMBOL', 'CHROMOSOME')], adjust.method = "BH")

dm can be created by:

Status <- as.factor(rep(c(1, 0), times = 14)) Gender <- as.factor(rep(c(0,1), times = 14)) Age <- as.numeric(c(28:55)) Batch2 <- as.factor(rep(c(1,0,0),length.out=28)) Batch3 <- as.factor(rep(c(0,1,0),length.out=28)) df = data.frame(Status, Gender, Age, Batch2, Batch3)

dm <- model.matrix(~1 + Status + Gender + Age + Batch2 + Batch3,data=df)

Reading a question on creating model.matrix using limma and Limma Model Matrix Understanding I'm just not sure whether I'm actually omitting or including an intercept although the model looks like I'm including one (which I think I should be doing since age is continuous and there's other things probably going on which I couldn't include in the model).

microarray limma methylation • 863 views
modified 2.1 years ago by Aaron Lun24k • written 2.1 years ago by Sarah Nesbitt0
3
2.1 years ago by
Aaron Lun24k
Cambridge, United Kingdom
Aaron Lun24k wrote:

You are including an intercept with ~1. However, it doesn't really matter whether you include the intercept or not, provided that you correctly interpret the coefficients. The meaning of each term will change if you drop the intercept, even if the columns of the design matrix have the same names.