Limma: Models containing an intercept and interactions with continuous variables.
0
0
Entering edit mode
Aashil • 0
@e76311d2
Last seen 12 months ago
Switzerland

Hello!

If I have something akin to the design matrix below which contains two factors and a continuous response variable:

set.seed(1)
library(limma)

data <- data.frame(treatment = factor(c(rep("control", 15),rep("treatment", 15))), 
                   time = factor(rep(c(rep("time1", 5),rep("time2", 5),rep("time3", 5)),2)),
                   response = as.numeric(sample.int(50, 30, replace = TRUE)),
                   location = sample(LETTERS[1:5],30, replace = T)
                   )
data$Treatment_Time <- paste(data$treatment, data$time, sep = "_")
dm <- model.matrix(~Treatment_Time*response+location, data)
colnames(dm) <- gsub("Treatment_Time", "", colnames(dm))

and will produce the coefficients for the following:

(Intercept)
control_time2
control_time3
treatment_time1
treatment_time2
treatment_time3
response
locationB
locationC
locationD
locationE
control_time2:response
control_time3:response
treatment_time1:response
treatment_time2:response
treatment_time3:response

Is taking the coefficients for treatment_time1:response essentially treatment_time1:response - control_time1:response? Since response is continuous I include an intercept but expected an interaction term for the control at time1 with response to make the comparison.

I hope someone can help,

Thanks!

limma edgeR DifferentialExpression • 471 views
ADD COMMENT

Login before adding your answer.

Traffic: 773 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