Using tidy data with Bayesian models2 years ago
Introduction | Philosophy | Supported model types | Setup | Example dataset | Using compose_data to prepare a data frame for the model | Extracting draws from a fit in tidy-format using spread_draws | Extracting model variable indices into a separate column in a tidy format data frame | Automatically converting columns and indices back into their original data types | Point summaries and intervals with the point_interval functions: [median|mean|mode]_[qi|hdi] | With simple variables, wide format | With indexed variables | Plotting points and intervals | Using geom_pointinterval | Intervals with posterior violins ("eye plots"): stat_eye | Other visualizations of distributions: stat_slabinterval | Intervals with multiple probability levels: the .width = argument | Plotting posteriors as quantile dotplots | Alternative point summaries and intervals: median, mean, mode; qi, hdi, hdci | Combining variables with different indices in a single tidy format data frame | Posterior predictions | Posterior predictions with posterior distributions of means | Comparing levels of a factor | Gathering all model variable names into a single column: gather_draws and gather_variables | Selecting variables using regular expressions | Drawing fit curves with uncertainty | Compatibility with other packages | Compatibility of point_interval with broom::tidy: A model comparison example | Compatibility with bayesplot using unspread_draws and ungather_draws | Compatibility with emmeans (formerly lsmeans) | Using rstanarm or brms | Using MCMCglmm
tidybayes 3.0.7.9000Matthew Kaytidybayes.Rmd