paul-buerkner / brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
https://paul-buerkner.github.io/brms/
GNU General Public License v2.0
1.28k stars 184 forks source link

conditional_effects plot for monotonic predictors - lineplot vs catergorial plot #1671

Closed Famondir closed 4 months ago

Famondir commented 4 months ago

Hi, I fitted a model with a model with monotonic predictor:

binomial_base_model_fs_mono <- brm(
  data = success_moduls,
  n_Prüfungsstatus | trials(n_Prüfungen) ~ 1 + mo(Semester),
  family=binomial(link='logit'),
  cores = 4,
  sample_prior = TRUE,
  file = "models/binomial_base_model_fs_mono.rds"
)

When variable Semester is numeric (integers) the conditional_effects plot shows a linegraph what was not expected:

image

Is there a easy way to get a categorial plot with errorbars like this?:

image

I had to refit the model and change the variable type to ordered to get this.

I tried to use the categorical, ordinal and re_formula options from conditional_effect but had no luck.

paul-buerkner commented 4 months ago

Hi, please ask brms related questions on Stan discourse.