Learn R Programming

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

tidybayes (version 3.0.6)

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

4,991

Version

3.0.6

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Kay

Last Published

August 12th, 2023

Functions in tidybayes (3.0.6)

compare_levels

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

Use emmeans contrast methods with compare_levels
combine_chains

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

Add draws to a data frame in tidy format
data_list

Data lists for input into Bayesian models
compose_data

Compose data for input into a Bayesian model
gather_emmeans_draws

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

Density bins and histogram bins as data frames
add_epred_draws

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

Add rvars for the linear predictor, posterior expectation, posterior predictive, or residuals of a model to a data frame
get_variables

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

Prefix function generator for composing dimension index columns
nest_rvars

Nest and unnest rvar columns in data frames
recover_types

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

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

Deprecated: Prediction curves for arbitrary functions of posteriors
sample_draws

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

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

Objects exported from other packages
gather_draws

Extract draws of variables in a Bayesian model fit into a tidy data format
tidybayes-package

Tidy Data and 'Geoms' for Bayesian Models
tidybayes-models

Models supported by tidybayes
tidy_draws

Get a sample of posterior draws from a model as a tibble
summarise_draws.grouped_df

Summaries of draws in grouped_df objects
gather_rvars

Extract draws from a Bayesian model into tidy data frames of random variables
tidybayes-deprecated

Deprecated functions, arguments, and column names in tidybayes
x_at_y

Generate lookup vectors for composing nested indices
ungather_draws

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