Entering edit mode
I am interested in the interaction between a stimulation of various cell lines and a specific genotype. I am particularly interested in the following contrasts:
- Differences between genotypes without stimulation (both Con HLA Pos vs Con HLA Neg and PDL HLA Pos vs PDL HLA Neg conditions)
- Differences between genotypes with stimulation (Fib HLA Pos vs Fib HLA Neg)
Therefore, I planned to run an interaction model like this:
form <- ~ 0 + HLA*Stim + (1 | ID)
However, I am stuck on how to setup contrasts for this more complex model. I'm sharing my metadata here for reference:
Any insight into the call I can make to makeContrastsDream for this interaction analysis? I looked at the examples provided online for making contrasts but didn't see an example with an interaction to follow.
gabriel.hoffman any insight?
The simplest way to handle contrasts with an interaction term is to create a new variable. Lets consider a simpler case with variables
Sex
with levelsF
andM
, andAge
with levelsYoung
andOld
:Instead of defining your interaction term in the formula, you can define a new variable explicitly. Then you can use formula
~ 0 + Inter + ...
. You can then define contrasts using levelsF_Young
andM_Young
: