5
$\begingroup$

This is the emmeans output of my lmer() model. I want to report this in a written format.

I have two groups, where each did a pre and posttest, as well as undergoing two different training methods.


$emmeans
 Gruppe Session  emmean    SE   df lower.CL upper.CL
 EF     Pretest    2.29 0.204 23.0     1.86     2.71
 IF     Pretest    2.31 0.196 23.0     1.90     2.72
 EF     Posttest   1.66 0.193 23.3     1.26     2.06
 IF     Posttest   1.72 0.182 22.4     1.35     2.10

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 

$contrasts
 contrast                  estimate    SE   df t.ratio p.value
 EF Pretest - IF Pretest    -0.0229 0.284 23.0  -0.081  0.9998
 EF Pretest - EF Posttest    0.6229 0.128 22.6   4.856  0.0004
 EF Pretest - IF Posttest    0.5614 0.274 27.6   2.052  0.1941
 IF Pretest - EF Posttest    0.6459 0.275 28.3   2.348  0.1110
 IF Pretest - IF Posttest    0.5843 0.118 21.9   4.937  0.0003
 EF Posttest - IF Posttest  -0.0615 0.265 22.9  -0.232  0.9954

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 4 estimates 

I struggle to understand how emmeans contrasts knows how to differ groups between:

"between group" and "within group".

I feel the "EF Pretest - IF Posttest" and "IF Pretest - EF Posttest" do not make sense to compare. And will this affect the P value?

NB: This may be a dumb question but I'm self-taught in statistics, so I struggle with some fundamentals.

my data set

structure(list(BIB. = structure(c(10L, 25L, 22L, 7L, 8L), levels = c("1", 
"2", "3", "4", "5", "6", "8", "9", "10", "11", "12", "13", "14", 
"15", "16", "20", "21", "22", "23", "24", "25", "26", "27", "28", 
"29"), class = "factor"), Gruppe = structure(c(1L, 1L, 2L, 2L, 
2L), levels = c("EF", "IF"), class = "factor"), Run = c(1, 1, 
1, 1, 1), `Performance Time` = c(3.265, 2.665, 2.295, 2.87, 1.245
), Session = structure(c(1L, 1L, 1L, 1L, 1L), levels = c("Pretest", 
"Trening 1", "Trening 2", "Posttest"), class = "factor")), row.names = c(NA, 
-5L), class = c("tbl_df", "tbl", "data.frame"))

ps: just filter "Trening 1", "Trening 2"

AL <- AD %>%
+   filter(`Session` != "Trening 1", `Session` !="Trening 2") %>%
+   select("BIB.", "Gruppe", "Performance_Time", "Session")

the model

LearningMod <- lmer(Performance_Time ~ Gruppe*Session + (1+Session|BIB.), data = AL)
$\endgroup$
2

1 Answer 1

8
$\begingroup$

If there are comparisons you don't think are appropriate, then you really shouldn't do them. And yes, it does affect the Tukey-adjusted P values.

What I suggest instead is something like this (assuming the two factors interact):

EMM <- emmeans(model, ~ Session * Gruppe)
EMM     # display the means

pairs(EMM, by = "Gruppe")    # compare sessions for each group

pairs(EMM, by = "Session")   # compare groups for each session

Another thing that makes sense is

contrast(EMM, interaction = c("consec", "pairwise"))

which would compare the comparisons: Posttest - Pretest | EF with Posttest - Pretest | IF.

Apparently, several influential people are suggesting that users run emmeans with pairwise ~ <every factor combination> specs, and I wish they'd stop doing that. It requires only one command, but it often creates a mess. I would like to encourage users to instead get the means, then do the comparisons they need, as is done above.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.