Learn R Programming

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

tidybayes (version 1.0.4)

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

1.0.4

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Kay

Last Published

February 19th, 2019

Functions in tidybayes (1.0.4)

gather_emmeans_draws

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

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

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

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

Compose data for input into a Bayesian model
geom_eye

Eye plots of densities with point and interval summaries (ggplot geom)
geom_lineribbon

Line + multiple probability ribbon plots (ggplot geom)
geom_pointinterval

Point + multiple probability interval plots (ggplot geom)
tidy_draws

Get a sample of posterior draws from a model as a tibble
tidybayes-deprecated

Deprecated functions, arguments, and column names in tidybayes
gather_draws

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

Multiple probability interval plots (ggplot stat)
data_list

Data lists for input into Bayesian models
density_bins

Density bins as data frames suitable for use with predict_curve
combine_chains

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

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

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

Deprecated: Prediction curves for arbitrary functions of posteriors
stat_lineribbon

Line + multiple probability ribbon stat for ggplot
stat_pointinterval

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

Base ggproto classes for tidybayes
n_prefix

Prefix function generator for composing dimension index columns
get_variables

Get the names of the variables in a fitted Bayesian model
tidybayes-models

Models supported by tidybayes
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
geom_halfeyeh

Half-eye plots of densities with point and interval summaries (ggplot geom)
geom_interval

Multiple probability interval plots (ggplot geom)
theme_tidybayes

Simple, light ggplot2 theme for tidybayes
tidy-format-translators

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

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

Generate lookup vectors for composing nested indices
recover_types

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

Sample draws from a tidy-format data frame of draws