I cannot get the conditional_effects I am aiming for when plotting ordinal data

Just for good measures, I am running BRMS 2.14.4 on Win10

I am trying to model and visualize an ordinal factor predicted by an interaction of another factor and a continuous feature.

I have tweaked the trolley data from Mcelreath’s rethinking package to approximate the kind of data I have. There is probably not an actual pattern in this data which is why I am not caring about convergence and such.

Ideally. I am interested in the rate of each response for education over the duration of the experiment as can be seen here on raw data.


My model is specified:

brm(response  ~ edu*mo(order) + (1|id), data= data,
          family = cumulative(threshold = "flexible"),
          chains = 2)

I have tried to see if there is some straightforward way to make the plot which corresponds to the above using

conditional_effects(m1, categorical=T)

And

conditions <- make_conditions(m1, "response")
conditional_effects(m1,categorical=TRUE, conditions = conditions)

Neither plot gives me exactly what I am hoping for. I hope that there is some easy way to achieve it? The code to replicate the above is here conditional effect - Pastebin.com

Thanks for reading.

1 Like

Hi,
sorry for not getting to you earlier. I don’t have very big experience with conditional_effects, but it is quite possible it just doesn’t cover your use case - if it does than manipulating the conditions would be way to go. More generallly, conditional_effects really just plots model predictions for a (specific, somewhat constrained) set of data. So maybe the easiset way to generate those plots is to just create a suitable dataset and use posterior_predict or posterior_epred with the newdata argument (or add_predicted_draw / add_fitted_draws from tidybayes) to generate the predictions for all combinations of edu and order and then plot those exactly as you need?

Best of luck with your model!