Limma Model Design
1
0
Entering edit mode
@sarah-nesbitt-13186
Last seen 6.9 years ago
Newcastle University

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).

Could anyone clarify this please?

limma methylation microarray • 1.5k views
ADD COMMENT
3
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 18 hours ago
The city by the bay

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.

ADD COMMENT

Login before adding your answer.

Traffic: 588 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6