pairwise comparison error message

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’

Not necessarily, why you don't simply check your assumption?

If you need specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.