I am doing an analysis in which I use generalized linear modelling. I need to know if there is any interaction of the predictors.Also, I am interested to know in what way the individual levels affect the colour.
My first doubt is can we consider categorical and numerical variables together as predictors in glm?
My response variable is two colours, and the predictors have two continuous variables, weight(W) and time in days (T). Other predictors are categorical. my starting model is involving interaction in all five factors.
model1<- glm(C~H*P*W*S*T, family=binomial, data=s1)
When I run this command, there is a warning message displayed, fitted probabilities 0 or 1 occurred. should I go ahead in spite of this warning. after this step, I did
summary(model1) anova(model1, test="Chisq")
then I removed each non significant term and reached a stage where only three factors independently affect the response variable.
is the likelihood ratio test sufficient to tell me about the fit of this model because I do get a significant chi squared if i remove any of these terms?
anova(finalmodel, finalmodel-H/P/T, test='LRT')
Lastly if we need to do the post hoc using glht for pair wise comparison
ph1<- glht(finalmodel, mcp(H="Tukey"))$linfct ph2<- glht(finalmodel, mcp(P="Tukey"))$linfct summary(glht(finalmodel,linfct=rbind(ph1, ph2)))
is this the right way to find out pair wise comparisons. Also, i could not include the third term , T because there was a message saying it is not a factor and all the time it was appearing in blue ink on the screen.