# I cannot get the conditional\_effects I am aiming for when plotting ordinal data

**URL:** <https://discourse.mc-stan.org/t/i-cannot-get-the-conditional-effects-i-am-aiming-for-when-plotting-ordinal-data/20986>\
**Category:** brms\
**Tags:** visualisation, interpret-results\
**Created:** [February 25, 2021, 10:56am UTC](https://discourse.mc-stan.org/t/i-cannot-get-the-conditional-effects-i-am-aiming-for-when-plotting-ordinal-data/20986 "2021-02-25T10:56:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon.dp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/simon.dp/32/2474_2.png) [@simon.dp](https://discourse.mc-stan.org/u/simon.dp)\
**Post date:** [February 25, 2021, 10:56am UTC](https://discourse.mc-stan.org/t/i-cannot-get-the-conditional-effects-i-am-aiming-for-when-plotting-ordinal-data/20986/1 "2021-02-25T10:56:53Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/b/b1d77c243908184db5df4cb33331f84a62ac8e94.png)  
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](https://pastebin.com/vFT8KKhu)

Thanks for reading.

---

<div class="post-metadata">

**Author:** ![martinmodrak](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/martinmodrak/32/133_2.png) [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Post date:** [March 5, 2021, 8:30pm UTC](https://discourse.mc-stan.org/t/i-cannot-get-the-conditional-effects-i-am-aiming-for-when-plotting-ordinal-data/20986/2 "2021-03-05T20:30:12Z")

</div>

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!
