Hi,
I've been trying to redo a contrast using makeContrasts. The contrast was originally made using the coefficients, but I realized I did not really understand what it actually was doing, however I've been unable to recreate the results using the makeContrasts command.
design <- model.matrix(~0+targets$group, data=y$samples)
y <- estimateDisp(y,design,robust=TRUE)
fit <- glmQLFit(y, design,robust=TRUE)
colnames(fit)
[1] "T1.LD.FW" "T2.LD.FW" "T2.SP.FW" "T3.LD.FW" "T3.SP.FW" "T4.LD.FW" "T4.SP.FW" "T4.SPLD.FW"
[9] "T5.LD.FW" "T5.SP.FW" "T5.SPLD.FW" "T6.LD.FW" "T6.SP.FW" "T6.SPLD.FW"
SPLLvsLL <- glmQLFTest(fit, contrast = c(0,0,0,0,0,-1,0,1,-1,0,1,-1,0,1))
Originally I thought it would work like the example in 3.3.1 in the user guide, with contrast=c(-1,0,1,1,0,-1)
being equivalent to the the DrugvsPlacebo.2h contrast, but writing it out as
t<- makeContrasts (SPLDvsLD = (T6.SPLD.FW-T6.LD.FW) - (T5.SPLD.FW-T5.LD.FW) - (T4.SPLD.FW-T4.LD.FW), levels=design)
is not providing the same results. So I guess there's something I do not understand/a point that I'm missing. I've also tried some other 'creative' ways of writing this out without getting to the same results. I noticed that the signs for the placebo-coefficients are opposite to the drugs in the example of 3.3.1?
T1, T2, T3, T4, T5, T6 refers to timepoints for the sampling throughout the experiment, and LD, SP, SPLD refers to the treatments. The FW component is not relevant, it refers to one out of two conditions in the original experiment, but I'm just interested in the differences between treatments over time in the FW-condition. I realize that I might be better of running pairwise comparisons between treatments for each timepoint, but in any case I would like to gain some understanding of the above as well.
I'd much appreciate it if anyone has the time to clarify this for me,
Maiv :)
What hypothesis are you attempting to test with this contrast? We can't tell you if your contrast is testing what you want to test unless you say what you want to test.
In any case, the contrast you have written appears to be subtracting two terms from one term, which usually yields a nonsense contrast.
Thanks for replying, I suspected that it might be the case that it was a nonsense contrast since I could not redo it using make contrast.
Quick follow-up question to check my understanding; would
produce an output of genes that are responding to SPLD condition at T6, but not at T5 and T4?
I'll assume you meant
T5.LD.FW
instead ofT5.SP
. If so, you are testing the T6 difference against the mean of the T5 and T4 differences. That's not quite the same as what you're after. In any case, I find that these "difference of differences" contrasts are difficult to interpret without the context of the individual differences. For instance, a significant p-value in the above contrast could indicate that the gene is changing at T6 but not at T5 and T4, or vice versa. Or there could be changes at all time points, but in different directions.