1
$\begingroup$

I'm estimating a GLM with two categorical variables and their interaction. The outcome is binary (incidence) and the two variables are group (2 genotypes) and treatment (3 levels). My R code for the main model:

model <- glm(incidence ~ group*treatment, data=ags, family="binomial")

Now, I want to determine the main effect for both group, treatment and their interaction. I have been teached (or at least this is how I understood it), that you could achieve this for linear models in general by comparing model fits, like so:

model1 <- glm(incidence ~ group + treatment, data=ags, family="binomial")
model2 <- glm(incidence ~ group, data=ags, family="binomial")
model3 <- glm(incidence ~ treatment, data=ags, family="binomial")

# main effect "group:treatment"
anova(model1, model, test = "Chisq")

# main effect "treatement"
anova(model, model2, test = "Chisq")

# main effect "group"
anova(model, model3, test = "Chisq")

Note that for both main effects for both group and treatment I compare the full model vs. a model that lacks both the variable of interest as well as the interaction.

Now, an alternative strategy would be to do a Type I, II or III ANOVA, like so:

# example Type I ANOVA
anova(model, test="Chisq")

Would this be preferred over the first method (given that the correct type of ANOVA is used)? And why? Also, to my understanding, my model comparison method is not equal to each of the ANOVA types, correct?

$\endgroup$

2 Answers 2

1
$\begingroup$

One sensible will be to first check whether the interaction effect is significant or how strong the effect is. In your case, this would for example indicate whether the treatment effect differs between genotypes. Use this to decide if there's a need to include it in the model. If it is, you should use anova(model, test="Chisq"). Your other comparisons are not equal because the main effects are differently estimated in the absence of the interaction term.

It might be a bit hard to properly estimate the main effect, for example, imagine the treatment has totally different effect in the two different genotypes. So take this into consideration. If your question is more about whether there is a genotype specific treatment effect, then this is maybe not so important.

If the interaction effect is not significant or most likely you can use model1 and compare it against model2 and model3.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you for your reply. The interaction is not significant in the main model, but it is very reasonable to a priori consider a treatment effect because of rationale and study design. I therefore included it in the model. Additionally, there is a trend for treatment and a highly significant effect for group. $\endgroup$
    – RmyjuloR
    Apr 30, 2020 at 3:29
1
$\begingroup$

Your strategy does not test if the main effects are significant.

# main effect "group:treatment"
anova(model1, model, test = "Chisq")

tests an interaction, which is not a main effect. And it tests whether it adds much to the main effects model.

# main effect "treatement"
anova(model, model2, test = "Chisq")

Tests whether group and the interaction add anything to the model with only treatment. And this alternate:

# example Type I ANOVA
anova(model, test="Chisq")

tests both main effects and the interaction, combined, so each effect is controlling for the other variables. If you want to test main effects, your initial models do it:

model2 <- glm(incidence ~ group, data=ags, family="binomial")
model3 <- glm(incidence ~ treatment, data=ags, family="binomial")

You just need to get the summary of each.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.