Discover and explore top open-source AI tools and projects—updated daily.
R package for Bayesian analysis, tidy data, and ggplot2 integration
Top 46.7% on SourcePulse
This R package simplifies integrating Bayesian modeling results into a tidy data workflow, primarily for users of ggplot2
. It streamlines data preparation for Bayesian models and transforms complex model outputs into easily visualizable, tidy data frames, enhancing the analysis and presentation of uncertainty.
How It Works
tidybayes
leverages the posterior
package for handling draws from Bayesian models and ggdist
for advanced statistical visualizations. Its core functions, like compose_data
and spread_draws
, automate the conversion of R data structures into formats suitable for Bayesian modeling software (e.g., Stan, JAGS) and then parse model output (parameter draws, predictions) into tidy data frames. This tidy format, with indices automatically converted back to original data types (like factors), is ideal for dplyr
manipulation and ggplot2
plotting, particularly with ggdist
geoms like stat_eye
and stat_lineribbon
.
Quick Start & Requirements
install.packages("tidybayes")
devtools::install_github("mjskay/tidybayes")
Highlighted Details
compose_data
.spread_draws
and gather_draws
.add_epred_draws
, add_predicted_draws
) for generating tidy predictions from models.ggdist
for advanced visualizations like eye plots, quantile dotplots, and uncertainty bands.tidybayes
and other R package formats (e.g., broom
, ggmcmc
).Maintenance & Community
Licensing & Compatibility
rstan
, brms
, rstanarm
, rjags
, and MCMCglmm
.Limitations & Caveats
The package is primarily focused on R and its ecosystem; integration with other statistical software or programming languages is not directly supported. While it supports numerous Bayesian model output formats, users must ensure their model output is compatible with the posterior
package's draw formats.
1 year ago
Inactive