Hi I am trying to know if are there confusion and interaction in a regression model, but I am not too sure how do it.
The first step for is create the model of the following way.
model = glm(data$enf ~ datos$smoke * datos$coffe * datos$trat, data = data, family = "binomial")
To know if there are interaction I used anova test of the model:
anova(model)
Response: data$enf
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev
NULL 89 123.653
data$smoke 1 42.790 88 80.863
data$caoffe 1 0.001 87 80.863
data$trat 1 0.086 86 80.777
data$smoke:data$coffe 1 0.069 85 80.708
data$smoke:data$trat 1 14.197 84 66.511
data$coffe:data$trat 1 0.000 83 66.511
data$smoke:data$coffe:data$trat 1 0.211 82 66.299
I am not sure if use anova over the model is enough for know the interaction between variables and I don't know to how interpret the output.
And I don't know how check the confusion.
anova()in this case can give surprising results. With the default R packages it does a sequential test, adding in predictors one at a time so that the results can differ depending on the order that the predictors were entered into the model. That might not be what you want. See this page for the different types of ANOVA analyses. – EdM Jan 01 '20 at 21:59