# Plotting conditional\_effects in brms

**URL:** <https://discourse.mc-stan.org/t/plotting-conditional-effects-in-brms/33610>\
**Category:** General\
**Tags:** brms\
**Created:** [December 18, 2023, 5:55am UTC](https://discourse.mc-stan.org/t/plotting-conditional-effects-in-brms/33610 "2023-12-18T05:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PG\_stan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/pg_stan/32/17528_2.png) [@PG\_stan](https://discourse.mc-stan.org/u/PG_stan)\
**Post date:** [December 18, 2023, 5:55am UTC](https://discourse.mc-stan.org/t/plotting-conditional-effects-in-brms/33610/1 "2023-12-18T05:55:13Z")

</div>

I have a model fitted in brms. I am trying to plot the conditional effects,

```no-highlight
mod2<-
  bf(
    PCFBPAGI ~ 
      E0 - (((expIPRED^G) * Emax)/((expIPRED^G) +EC50^G)), 
    E0 ~ 1 + (1|i|NID),
    Emax ~ 1 + (1|i|NID),
    EC50 ~ 1 + (1|i|NID),
    G ~ 1 + (1|i|NID),
    nl=TRUE
  )

fit2<-brm(mod2,
          data = subdat,
          prior = prior_1,
          chains = 3,
          future=T,
          seed=2021,
          iter = 4000,
          warmup = 1000)

conditions <- data.frame(NID = unique(subdat$NID))
rownames(conditions) <- unique(subdat$NID)
me_subdat<-
  conditional_effects(
    fit2, 
    effects = "expIPRED",
    conditions = conditions,
    re_formula = NULL,
    method = "predict"
  )

plot(me_subdat, ncol = 5, points = TRUE)

```

I have 102 unique values of NID. As you see above, I am using ncol=5, the plot I get is trying to dispaly all panels (all 102 NID values) in one page.

According to hte help for plot in brms ncol is described as:  
"Number of plots to display per column for each effect. If `NULL` (default), `ncol` is computed internally based on the number of rows of `conditions`.

But, plot I get is putting all 102 subpanels in 5 columns in one page. How do I define for example 5 columns and 5 rows for the plot to have 25 panels in each page?  
Do I have anything wrong in the model defined above that makes the plotting incorrect?  
Thanks for help in advance
