Hi, I’m running a multinomial regression model with brms. I would like to plot my model effects in the same way as using the famous effects::allEffects() function. I’ve tried the conditional_effects function but I’ve read some post about the fact that the effects package do some different things compared to conditional_effects.
How can I plot my model effects in the same way as effects? My model is:

fit <- brm(emotion ~ mimicry + (1|subject),
data = qualia,
cores = n_cores,
family = categorical,
sample_prior = TRUE,
iter = 6000)

And for plotting I use:

conditional_effects(fit, categorical = TRUE)

This is my session info:

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

I’m quite familiar with brms but not with 'effects::allEffects(). Could you just describe precisely what you are hoping to plot vs. what you are actually getting from brms? How many different plots and for what effects are you hoping to get out?

Thanks for your response! sorry for have taken for granted the effects package. Basically when you have a fitted model you can easily plot all effects computing marginal means and confidence intervals. I have read that the deprecated marginal_effects() now conditional_effects() do some different stuffs (no marginalization) so I’m wondering if there is a way to easily plot your brms model effect in the same way.

What type of variable is mimicry - is that continuous or a categorical predictor? And secondly what sort of response format is emotion -what values can it take? I’m just trying to get a sense of what you want to plot. I might be able to help more if you can describe what marginalised plot you want specifically.

Your effect of mimicry will be ‘marginalised’ over the subject effect, in the sense that the different subject intercepts cancel out to 0 when you look at the effect of mimicry. So if mimicry were categorical and had 3 possibilities, I think the conditional_effects plot would simply show estimated emotion scores and the 95% central posterior interval for each level of mimicry, for the ‘average’ subject in your experiment.

mimicry is a 2 level factor that represents 2 condition (within subject) of the experiment. Emotion is a 3 level factor that i would like to model as a function of mimicry. The idea is simply to have the fitted mean (in this case probability) with 95% CI for each level so 3 emotion times 2 mimicry level -> 6 means.

Okay. And just to check - is emotion ordered (like low, medium, high) or just unordered categories (like happy, angry, sad)? If ordered, you might consider a cumulative model like probit, and in that case I think the plot already would kind of come out like you are hoping for. Sorry for all the questions but could you share the output you get for fit, and also a screenshot of what the plot looks like right now for conditional effects? That will just help to understand what the model is trying to do and perhaps how it could be adapted to get what you want.

I think the plot is giving you pretty much what you want? - those probability estimates will be reflecting the average predicted probability over the participants under each condition. The central point is most likely the mean of the posterior distribution estimate, and the lines are like a confidence interval - in this case I think they reflect the middle 95% of estimates from the posterior distribution.

The only thing I note in your model that you may have a preference for changing is that right now ‘happy’ and ‘free’ appear to be used as your reference level/intercept - so the model is estimating the probabilities of mixed and neutral as deflections from happy, and blocked as deflections from free. Just depending on how you think of your outcomes and experimental manipulation, you might want to choose a difference level as the reference point or intercept. E.g., imagining you had neutral, angry, and happy, you might want to make neutral the reference point to make it easier to understand your model as angry and happy having probabilities in relation to neutral as an anchor point. I think it is just choosing the reference point alphabetically, so in your case happy comes before mixed and neutral. If you did want to change it (and there is no necessity to if it is not your preference) you could name your variables like 0neutral, 1happy, 2mixed or whatever.

But I think you can consider your plot to be a reflection of the fitted mean estimates.