Skip to content
Prev 6841 / 20628 Next

Calculating main effects

Iker Vaquero Alba <karraspito at ...> writes:
The issue of testing main effects (such as C) in the presence of
interactions (such as C:B -- note that C*B is equivalent to
C + B + C:B) is long-standing and contentious.  There are several points
of view:

  * Bates, Venables, and others (google for "Venables Exegeses Linear
Models") seem to advocate stepwise removal of unnecessary (non-significant?
weak?) interaction terms so that main effects can be tested without
ambiguity. This is essentially the point you made above ("I have to
remove C:B before I can test C").
  * **If** continuous predictors are centered or categorical predictors
are coded with sum-to-zero contrasts, then it *may* make sense to
use 'marginal' or what SAS would call 'type III' tests to violate
marginality and test main effects in the presence of interactions
(see Venables' "exegeses" for a hint on how to do this): Schielzeth
2010 also seems to recommend this approach, although he focuses on
continuous predictors
 * However, Wald tests of parameters as provided by summary(), **or**
individual quantiles or highest posterior density intervals on individual
parameters, are marginal, so use them with the appropriate caution
(i.e. the estimates of the main effects depend on the contrasts used
and their comparisons to zero may or may not represent tests of
sensible hypotheses)
 * Be aware that in any case there is no simple way (that I know of)
to get R to construct a model matrix that includes interaction terms
but zeros out the main effects: compare the following

d <- expand.grid(C=factor(1:2),B=factor(1:2))
model.matrix(~C*B,data=d)
model.matrix(~C:B,data=d)
model.matrix(~C*B-B-C,data=d)