0

I am using the function ggpredict to display a lmer model's result.

The model has a continuous X (RT), one continuous Y (RC1) and 4 discrete factors (2x2x2x14). Model:

SailorJupiter <- lmer(RT~RC1*m2*m3*m5*m4 + (1|Trial:sonTrial) + (1|Subject) + (1|Trial) + (1|sonleft) + (1|sonright), data=audiostim, REML=FALSE)

library(see)
library(ggeffects)

a <- ggpredict(SailorJupiter, c("RC1","m2","m3","m4","m5"), dependencies=TRUE)
plot(a)

Example of plot without the 14-levels factor because it's too big

Question 1: I'd like to have results with groups being a combination of m3 and m4 in order to simplify the graphs. I tried :

 a <- ggpredict(SailorJupiter, c("RC1","m2","m3:m4","m5"), dependencies=TRUE)
    plot(a)

But it doesn't work.

Question 2: Is there a way to use only one level of a factor in order to simplify the plot ? I know some other plotting packages allow it, but can't find it in ggpredict().

c_R
  • 23
  • 3
  • 1
    Right now we can't run any code without a sample of data—try to make a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – camille Dec 07 '19 at 16:44
  • @Question 1: I'm not sure how you imagine this combination? How do you want to display the data, if you still want to differentiate between those two factors? @Question 2: Probably the `condition`-argument is what you're looking for, [see here](https://strengejacke.github.io/ggeffects/articles/introduction_effectsatvalues.html#marginal-effects-conditioned-on-specific-values-of-the-covariates). – Daniel Dec 11 '19 at 17:51
  • Hi Daniel! Thanks the condition argument is exactly what I was looking for. As for the first question, I want 4 slopes: female - valid / female - invalid / male - valid / male - invalid. Maybe it's just not possible with ggpredict, but if it is I am curious about how it's specified. – c_R Dec 12 '19 at 10:13

0 Answers0