3
$\begingroup$

I have a rookie question about pairwise comparisons with emmeans following linear mixed effects modeling. I'm planning an experiment and I'm trying to thing of the correct statistical methods to analyze the data.

Let's say I have an experiment with two groups of participants (beginners vs. advanced) who are tested in three conditions (condition A, condition B, condition C). The order of conditions is counterbalanced. I'm interested in the analysis of their performance, so I have the following model formula:

model <- lmer(performance ~ group * condition + condition_order + (1|participant), data)

The model informs me about the main effect of condition (averaged across groups), the main effect of group (averaged across conditions), order effect, and the interaction of group x condition.

What I'd also like to see is whether there are any within-group differences, i.e., whether the performance of beginner and advanced participants differs across the three conditions when we look at both groups separately.

Would a pairwise comparison with emmeans be statistically sound in such a case? If so, is it OK to proceed with it even if there's no interaction detected in the model?

$\endgroup$

1 Answer 1

5
$\begingroup$

First, if there is an interaction, I'd suggest doing something like this:

EMM <- emmeans(model, ~ condition | group) EMM # Look at the estimated means pairs(EMM) # Look at pairwise comparisons for each group 

Also, a visual display of the means is also useful, e.g. an interaction-style plot:

emmip(EMM, group ~ condition) 

Ot is OK to do this also if there isn't much of an interaction, but I still suggest the interaction plot to see how strong the interaction looks, subjectively (just because it's not significant doesn't necessarily mean you can be comfortable ignoring it; you just may have inadequate data). If you're comfortable tossing out the interaction, probably the best thing to do is to re-fit the model without the interaction and do the emmeans analysis without the | group part.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.