# Thresholds for ordinal brms model in emmeans

**URL:** <https://discourse.mc-stan.org/t/thresholds-for-ordinal-brms-model-in-emmeans/20448>\
**Category:** brms\
**Tags:** emmeans\
**Created:** [January 26, 2021, 5:25pm UTC](https://discourse.mc-stan.org/t/thresholds-for-ordinal-brms-model-in-emmeans/20448 "2021-01-26T17:25:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrovska](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/petrovska/32/8375_2.png) [@petrovska](https://discourse.mc-stan.org/u/petrovska)\
**Post date:** [January 26, 2021, 5:25pm UTC](https://discourse.mc-stan.org/t/thresholds-for-ordinal-brms-model-in-emmeans/20448/1 "2021-01-26T17:25:36Z")

</div>

Dear community,

I wonder why an ordinal mixed effect model in `brms` does not have thresholds in `emmeans/emmip`? In my case, the outcome is some mean probability over all thresholds, i.e. response range. Is it possible to get the marginal probability for each threshold?

For example, in the package `ordinal` all thresholds are coded as “cut” variables and can be identified in `ref_grid` in `emmeans` [example](https://cran.r-project.org/web/packages/emmeans/vignettes/sophisticated.html). How can I identify thresholds in `emmeans` providing my model is fitted in `brms`? Maybe I miss some details in coding?

Note: I do not use `conditional_effects` here, as I would like to estimate marginal mean at different offset values and `emmip` is more convenient for this.  
The fitted model is as following:

```
f = brmsformula(count1~ ba_sqrt + dbh_log + species.p + species.m + status.p +
position.m + y + offset(log(count_dead)) + (1+y|subplot_id), center=TRUE) +
lf(disc ~ 0 + y + status.p + species.p, cmc = FALSE)

fit=brm(f, data=d1, family=cratio(link="probit"), prior=p, 
save_pars=save_pars(all = TRUE), cores = 2, iter = 800 + 800, 
warmup = 800, chains = 1, seed=123,
sample_prior="yes", silent=TRUE, open_progress=FALSE, 
control = list(adapt_delta = 0.85, max_treedepth = 10))

# getting the grid in emmeans:
con = ref_grid(fit, at = list(status.p = "alive", ba_sqrt=1.41, 
dbh_log=seq(1.6, 3, by=0.1), bias.adj = TRUE))

# plotting
emmip(con, species.p ~ dbh_log | position.m, type="response", 
offset = log(4)) + theme(legend.position = "top") + 
geom_ribbon(data=b, aes(x=dbh_log, y=yvar, ymin=LCL, ymax=UCL, fill=species.p), alpha=0.25, inherit.aes = FALSE) + 
geom_line(data=b, aes(x=dbh_log, y=yvar, color=species.p), size=1, inherit.aes = FALSE)+ labs(x="log(dbh)

# outcome:
             species.p dbh_log position.m yvar LCL UCL
1 Acer platanoides 1.6 adjacent_dead 0.6778162 0.5495729 0.7993685
2 Acer pseudoplatanus 1.6 adjacent_dead 0.7822773 0.6304033 0.8995334
3 Fagus sylvatica 1.6 adjacent_dead 0.8808129 0.7851305 0.9499130
4 Ulmus glabra 1.6 adjacent_dead 0.5135319 0.3046328 0.6891265

```

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/6/6c60b3bbaf539cb8c193adf3546e2f1c8eddaba1.png)  
I would appreciate any idea or hints very much.

- Operating System: Windows 10
- brms Version: 2.14.0
