Question: limma 3-way interaction

0

Jacob Michaelson •

**320**wrote:Hi all,
A while back I found some great code on the list to test for a two-way
interaction in limma:
> If you only want F-tests for interactions, the following code would
work:
>
> X <- model.matrix(~a*b)
> fit <- lmFit(eset, X)
> p <- ncol(X)
> cont.ia <- diag(p)[,attr(X,"assign")==3]
> fit.ia <- eBayes(contrasts.fit(fit, cont.ia))
>
> Now fit.ia contains the F-statistic and p-values for the interaction
in
> fit.ia$F and fit.ia$F.p.value.
>
This code has worked very well for me. I hand-coded an interaction
using contrasts and got the exact same results as with using the above
code - which was encouraging.
How could this code be adapted for a three-way interaction, ie:
X=model.matrix(~a*b*c)
Is it safe to just to substitute this line?
Any help much appreciated!
--Jake