I have a model with 2 main factors and its interaction:
designmodel = model.matrix(~0 + Factor1 + Factor2 + Factor1:Factor2)
Factor 1 has two levels and factor 2 has 4 levels. My question is if when I test the interaction term I can add all 8 groups as follow:
contrastInteraction = makeContrasts(((Factor1.Level1Factor2 - Factor1.Level2Factor2 - Factor1.Level3Factor2 - Factor1.Level4Factor2 ) - (Factor2.Level1Factor2 - Factor2.Level2Factor2 - Factor2.Level3Factor2 - Factor2.Level4Factor2)), levels=design)
Or shoud I test the interaction in 4 separate contrasts (one for each level of factor 2)? Thanks for you advice!