I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values**;** Explicatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF)**;**individual as a random effect variable After running a lmer function, and checking for assumptions, I want to perform *a posteriori* specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB, how do I write that in the script in R?? THANKS! **CODE IS AS FOLLOWS** #Model: m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos) summary(m1) e1<-resid(m1) pre1<-predict(m1) windows() par(mfrow = c(1, 2)) plot(pre1, e1, xlab="Predichos", ylab="Residuos de pearson",main="Gráfico de dispersión de RE vs PRED",cex.main=.8 ) abline(0,0) qqnorm(e1, cex.main=.9) #QQ plot qqline(e1) par(mfrow = c(1, 1)) shapiro.test(e1) #Comparisons: model.matrix.gls <- function(object, ...) { model.matrix(terms(object), data = getData(object), ...) } model.frame.gls <- function(object, ...) { model.frame(formula(object), data = getData(object), ...) } terms.gls <- function(object, ...) { terms(model.frame(object), ...) } #Comparisons desired: #DB-DF #NDB-NDF #BB-BF #DB-BB Here I show how the data plot looks like, and the comparisons desired. [![enter image description here][1]][1] [1]: https://i.sstatic.net/niAEJ.png