Learn R Programming

⚠️There's a newer version (3.0.7) of this package.Take me there.

tidybayes (version 2.0.3)

Tidy Data and 'Geoms' for Bayesian Models

Description

Compose data for and extract, manipulate, and visualize posterior draws from Bayesian models ('JAGS', 'Stan', 'rstanarm', 'brms', 'MCMCglmm', 'coda', ...) in a tidy data format. Functions are provided to help extract tidy data frames of draws from Bayesian models and that generate point summaries and intervals in a tidy format. In addition, 'ggplot2' 'geoms' and 'stats' are provided for common visualization primitives like points with multiple uncertainty intervals, eye plots (intervals plus densities), and fit curves with multiple, arbitrary uncertainty bands.

Copy Link

Version

Install

install.packages('tidybayes')

Monthly Downloads

6,160

Version

2.0.3

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Kay

Last Published

April 4th, 2020

Functions in tidybayes (2.0.3)

data_list

Data lists for input into Bayesian models
density_bins

Density bins and histogram bins as data frames
compose_data

Compose data for input into a Bayesian model
compare_levels

Compare the value of draws of some variable from a Bayesian model for different levels of a factor
RankCorr

Thinned subset of posterior sample from a Bayesian analysis of perception of correlation.
add_draws

Add draws to a data frame in tidy format
gather_pairs

Gather pairwise combinations of values from key/value columns in a long-format data frame
add_fitted_draws

Add draws from the posterior fit, predictions, or residuals of a model to a data frame
geom_eye

Eye plots of densities with point and interval summaries (Deprecated spellings)
geom_interval

Multiple probability interval plots (ggplot geom)
combine_chains

Combine the chain and iteration columns of tidy data frames of draws
lkjcorr_marginal

Marginal distribution of a single correlation from an LKJ distribution
geom_lineribbon

Line + multiple probability ribbon plots (ggplot geom)
geom_pointinterval

Point + multiple probability interval plots (ggplot geom)
geom_slabinterval

Slab + point + interval meta-geom
geom_dotsinterval

Automatic dotplots, dots + intervals, and quantile dotplots (ggplot geom)
gather_emmeans_draws

Extract a tidy data frame of draws of posterior distributions of "estimated marginal means" (emmeans/lsmeans) from a Bayesian model fit.
marginalize_lkjcorr

Turn spec for LKJ distribution into spec for marginal LKJ distribution
point_interval

Point and interval summaries for tidy data frames of draws from distributions
parse_dist

Parse distribution specifications into columns of a data frame
n_prefix

Prefix function generator for composing dimension index columns
gather_variables

Gather variables from a tidy data frame of draws from variables into a single column
scales

Custom ggplot scales for geom_slabinterval (and derivatives)
stat_dist_slabinterval

Distribution + interval plots (eye plots, half-eye plots, CCDF barplots, etc) for analytical distributions (ggplot stat)
theme_tidybayes

Simple, light ggplot2 theme for tidybayes
get_variables

Get the names of the variables in a fitted Bayesian model
gather_draws

Extract draws of variables in a Bayesian model fit into a tidy data format
stat_interval

Multiple probability interval plots (ggplot stat)
stat_sample_slabinterval

Distribution + interval plots (eye plots, half-eye plots, CCDF barplots, etc) for samples (ggplot stat)
predict_curve

Deprecated: Prediction curves for arbitrary functions of posteriors
x_at_y

Generate lookup vectors for composing nested indices
tidybayes-models

Models supported by tidybayes
stat_lineribbon

Line + multiple probability ribbon plots (ggplot stat)
sample_draws

Sample draws from a tidy-format data frame of draws
stat_pointinterval

Point summary + multiple probability interval plots (ggplot stat)
tidybayes-deprecated

Deprecated functions, arguments, and column names in tidybayes
tidybayes-package

Tidy Data and 'Geoms' for Bayesian Models
ungather_draws

Turn tidy data frames of variables from a Bayesian model back into untidy data
recover_types

Decorate a model fit or sample with data types recovered from the input data
tidy_draws

Get a sample of posterior draws from a model as a tibble
tidy-format-translators

Translate between different tidy data frame formats for draws from distributions
stat_slabinterval

Meta-stat for computing slab functions and interval functions (ggplot stat)
tidybayes-ggproto

Base ggproto classes for tidybayes