Point + interval plot for model predictions

mc_obs_pointinterval(...)

mc_model_pointinterval(..., n_sample = NA, group_sample = "collapse")

Arguments

...

Augments passed to ggdist::stat_pointinterval.

n_sample

The number of sample of draws to show in pointinterval plot. Default NA. If n_sample is NA, then mc_model_pointinterval() will use all draws from posterior distribution.

group_sample

How to show draws? Default "collapse". If group_sample is "collapse", then all draws are collapsed together to show in one pointinterval plot; if group_sample is "group", then each draw is shown in an individual pointinterval plot; if group_sample is "hops", then mc_model_pointinterval() will use animation to show each draw in one frame; if group_sample is an function, then all draws are aggregated by group_sample(). See examples for more details.

Examples

library(ggplot2)

mcplot(mpg_model) +
  mc_model_pointinterval(n_sample = 50) +
  mc_obs_pointinterval() +
  mc_gglayer(coord_flip())
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.


mcplot(mpg_model) +
  mc_model_pointinterval(n_sample = 50) +
  mc_obs_pointinterval() +
  mc_condition_on(x = vars(disp))
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.