I am trying to do a pairwise comparison to see which spiders are different but R keeps returning an error. I don't understand, spiders are written as words in the data set so surely should be factors automatically?
loc3glm<-glm (locomotion ~ post_handling_day+spider,
family = "binomial", data = threespiders)
loc3comparison <- glht(loc3glm, linfct = mcp(spider = "Tukey"))
Error in mcp2matrix(model, linfct = linfct) :
Variable(s) ‘spider’ of class ‘character’ is/are not contained as a factor in ‘model’