Hi Prof. Gordon Smyth,
I have a question about the meaning of interaction terms in design matrix on the page 38 in the edgeR User's Guide. In line 19, the guide say: "The last two coefficients give the DrugvsPlacebo.1h and DrugvsPlacebo.2h contrasts". But my understanding is that the last two coefficients ( [5] "TreatDrug:Time1h", [6] "TreatDrug:Time2h" in model.matrix(~Treat * Time, data=targets)) could be the difference of difference, which means the effects (Drug.1h-placbo.1h)-(Drug.0h-placebo.0h) and (Drug.2h-placbo.2h)-(Drug.0h-placebo.0h). (Drug.0h-placebo.0h) is the reference level for interaction. Is my understanding right?
Best, Mingxing Yang
Thank you for your time, Gordon. Actually, my understanding of interaction terms [5] "TreatDrug:Time1h", [6] "TreatDrug:Time2h" are (Drug.1h-placbo.1h)-(Drug.0h-placebo.0h) and (Drug.2h-placbo.2h)-(Drug.0h-placebo.0h) respectively, which are different from the definition on page 36 of the Guide: DrugvsPlacebo.1h = (Drug.1h-Drug.0h)-(Placebo.1h-Placebo.0h), DrugvsPlacebo.2h = (Drug.2h-Drug.0h)-(Placebo.2h-Placebo.0h)
That is why I asked this question. Because this is very confusing and only a few people understand this, that is why I only asked you this question.
Best, Mingxing Yang
Simple arithmetic shows you that the two expressions are exactly the same:
(Drug.1h - Placbo.1h) - (Drug.0h - Placebo.0h)
= Drug.1h - Placebo.1h - Drug.0h + Placebo.0h
= (Drug.1h - Drug.0h) - (Placebo.1h - Placebo.0h)
Many thank, Gordon. Yes, they are the same.