Skip to content

conditional_effects and points for binomial model #1826

@avehtari

Description

@avehtari

The following plots the conditional effects as probability but the data points as counts. I was not able to figure out how to have both either in probability scale or count scale. If it's possible, then documentation could be updated, if it's not possible then additional argument to make it possible could be added

library(brms)
options(brms.backend = "cmdstanr", mc.cores = 4)
ggplot2::theme_set(bayesplot::theme_default(base_family = "sans", base_size=16))

df_bioassay <- data.frame(
  dose = c(-0.86, -0.30, -0.05, 0.73),
  batch_size = c(5, 5, 5, 5),
  deaths = c(0, 1, 3, 5)
)

bfit1 <- brm(deaths | trials(batch_size) ~ dose,
             family = binomial(),
             data = df_bioassay,
             refresh = 0)

plot(conditional_effects(bfit1), points=TRUE)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions