# Model comparison using ANOVA with significant interaction

This seems like a simple question, but I can't seem to find a clear answer, so perhaps it isn't...

Let's suppose I fit a two-way linear model with interaction term. So in R,

fullmodel <- lm(Y ~ A * B)


now

summary(model)


will give me marginal significance values for A, B and the A*B interaction. Looking at my output, I note that the interaction is significant, meaning that given that A and B are in the model, adding the interaction between them is warranted.

But I want to test the hypothesis that "B is important in predicting Y". To do this, my instinct is to use ANOVA to compare a model with B to one without.

ANOVA(modelwithB, modelwithoutB)


To me, it seems logical that

modelwithoutB <- lm(Y ~ A)


and so the comparison should be

ANOVA(fullmodel, modelwithoutB)


This means that I compare a model with just A to one with both a main effect of B and an A*B interaction. Do people concur? Or is there something flawed in my reasoning (or perhaps in my hypothesis)?

• this seems correct. – Ben Bolker Jan 5 '18 at 0:54
• Welcome to the stats.stackexchange.com. Indicate briefly about sample data and characteristics of data as well as your objectives. – Subhash C. Davar Jan 5 '18 at 0:57