Hi, I am trying to build a model matrix in limma to perform differential analysis of my features. I have a simple phenodata like this:
Sample condition
dmso_1 control
dmso_2 control
dmso_3 control
pi3_1 drug
pi3_2 drug
pi3_3 drug
I want to see differential changes 2 conditions control and drug. I have seen from tutorial videos that you can either include the intercept or not. What I don't understand is sometimes ~-1 is used, sometimes ~1 or ~0 is used. Can you tell whether my matrix will work and what exactly is the difference between coefficients?
design <- model.matrix(~-1 + factor(rep(1:2, each=3)))
colnames(design) <- c("dmso","pi3")
contrast <- makeContrasts(dmso - pi3, levels = design)
fit <- lmFit(file.mat, design)
fit2 <- contrasts.fit(fit, contrast)
fit2 <- eBayes(fit2)
Also if I don't want to use the intercept, how can I build the matrix?
Thanks