Skip to main content
added 468 characters in body
Source Link
Russ Lenth
  • 21.3k
  • 33
  • 70

Please look at the documentation for emmeans::contrast; it provides for such comparisons:

library("emmeans")
emm <- emmeans(m1, "Condicion")
contrast(emm, list(
    `DB-DF` = c(-1,1,0,0,0,0),
    `NDB-NDF` = c(0,0,-1,0,0,0),
    `BB-BF` = c(0,0,0,0,-1,1),
    `DB-BB` = c(-1,0,0,0,1,0)
))

Note: This is based on the assumption that the levels of Condicion are in the order given in the question. If they are not, then they are probably in alphabetical order (the default) and you need to either permute the 1s and -1s accordingly, or create

Datos$Condicion <- factor(as.character(Datos$Condicion),
    levels = c("DB", "DF", "NDB", "NDF", "BB", "BF"))

and then re-fit the model before using the above code to obtain the comparisons.

Please look at the documentation for emmeans::contrast; it provides for such comparisons:

library("emmeans")
emm <- emmeans(m1, "Condicion")
contrast(emm, list(
    `DB-DF` = c(-1,1,0,0,0,0),
    `NDB-NDF` = c(0,0,-1,0,0,0),
    `BB-BF` = c(0,0,0,0,-1,1),
    `DB-BB` = c(-1,0,0,0,1,0)
))

Please look at the documentation for emmeans::contrast; it provides for such comparisons:

library("emmeans")
emm <- emmeans(m1, "Condicion")
contrast(emm, list(
    `DB-DF` = c(-1,1,0,0,0,0),
    `NDB-NDF` = c(0,0,-1,0,0,0),
    `BB-BF` = c(0,0,0,0,-1,1),
    `DB-BB` = c(-1,0,0,0,1,0)
))

Note: This is based on the assumption that the levels of Condicion are in the order given in the question. If they are not, then they are probably in alphabetical order (the default) and you need to either permute the 1s and -1s accordingly, or create

Datos$Condicion <- factor(as.character(Datos$Condicion),
    levels = c("DB", "DF", "NDB", "NDF", "BB", "BF"))

and then re-fit the model before using the above code to obtain the comparisons.

Source Link
Russ Lenth
  • 21.3k
  • 33
  • 70

Please look at the documentation for emmeans::contrast; it provides for such comparisons:

library("emmeans")
emm <- emmeans(m1, "Condicion")
contrast(emm, list(
    `DB-DF` = c(-1,1,0,0,0,0),
    `NDB-NDF` = c(0,0,-1,0,0,0),
    `BB-BF` = c(0,0,0,0,-1,1),
    `DB-BB` = c(-1,0,0,0,1,0)
))