post-hoc pairwise comparisons for glmm with polynomial term

I fit a poisson glmm to my count data:

df1 <- data.frame(production=c(15,12,10,9,6,8,9,5,3,3,2,1,0,0,0,0), Treatment_Num=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4), Genotype=c(1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2), Source_Salinity=c("Fresh","Fresh","Brackish","Brackish","Fresh","Fresh","Brackish","Brackish","Fresh","Fresh","Brackish","Brackish","Fresh","Fresh","Brackish","Brackish"), Days_to_death <- c(500, 500, 500, 500, 400, 350, 300, 500, 200, 202, 260, 280, 150,150,160,140), censored <- c(1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0))


df1_glmer <- glmer(production ~ poly(Treatment_Num,2,raw=TRUE)*Source_Salinity +(1|Genotype),
                   data = df1, family = poisson(link = "log"))

And now I want to do pairwise comparisons to see if the Treatments (Treatment_Num) are different from one another. Normally I convert Treatment_Num from numeric to a factor and re-run the model in order to use lsmeans, but I can't do that this time since I have a polynomial term around Treatment_Num.

Is there another way to do pairwise comparisons in this situation?

Thank you!



Read more here: https://stackoverflow.com/questions/68092838/post-hoc-pairwise-comparisons-for-glmm-with-polynomial-term

Content Attribution

This content was originally published by Carrie Perkins at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: