Package overview

Overview of tidybayes.

tidybayes-package tidybayes

Tidy Data and 'Geoms' for Bayesian Models

tidybayes-models

Models supported by tidybayes

Composing data for input to a model

Transform tidy data frames into data lists appropriate for model types like Stan and JAGS

compose_data()

Compose data for input into a Bayesian model

data_list() as_data_list()

Data lists for input into Bayesian models

n_prefix()

Prefix function generator for composing dimension index columns

x_at_y()

Generate lookup vectors for composing nested indices

Extracting posteriors

Get tidy draws or rvars of posterior distributions from objects (and helper functions for examining objects)

get_variables()

Get the names of the variables in a fitted Bayesian model

recover_types()

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

gather_draws() spread_draws()

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

tidy_draws()

Get a sample of posterior draws from a model as a tibble

gather_emmeans_draws()

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

ungather_draws() unspread_draws()

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

gather_rvars() spread_rvars()

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

nest_rvars() unnest_rvars()

Nest and unnest rvar columns in data frames

summarise_draws(<grouped_df>)

Summaries of draws in grouped_df objects

Extracting fits, predictions, and residuals

Get tidy draws or rvars from transformed linear predictors (“fits”), posterior predictions, or residuals

tidybayes-deprecated ggeye add_fitted_draws fitted_draws fitted_draws.default fitted_samples add_fitted_samples predicted_samples add_predicted_samples gather_samples gather_lsmeans_samples gather_emmeans_samples gather_terms extract_samples tidy_samples spread_samples as_sample_tibble as_sample_data_frame ungather_samples unspread_samples parameters geom_eye geom_eyeh geom_halfeyeh geom_slabh geom_intervalh GeomIntervalh geom_pointintervalh GeomPointintervalh geom_dotsh geom_dotsintervalh stat_dist_eyeh stat_dist_halfeyeh stat_dist_slabh stat_dist_intervalh stat_dist_pointintervalh stat_dist_gradientintervalh stat_dist_cdfintervalh stat_dist_ccdfintervalh stat_dist_dotsh stat_dist_dotsintervalh stat_eyeh stat_halfeyeh stat_slabh stat_intervalh stat_pointintervalh stat_gradientintervalh stat_cdfintervalh stat_ccdfintervalh stat_dotsh stat_dotsintervalh stat_histintervalh point_intervalh mean_qih median_qih mode_qih mean_hdih median_hdih mode_hdih mean_hdcih median_hdcih mode_hdcih

Deprecated functions, arguments, and column names in tidybayes

add_epred_draws() epred_draws() add_linpred_draws() linpred_draws() add_predicted_draws() predicted_draws() add_residual_draws() residual_draws()

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

add_draws()

Add draws to a data frame in tidy format

add_epred_rvars() epred_rvars() add_linpred_rvars() linpred_rvars() add_predicted_rvars() predicted_rvars()

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

Manipulating tidy data frames of draws

Convenience functions for common data manipulation tasks with tidy data frames of draws

sample_draws()

Sample draws from a tidy-format data frame of draws

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

gather_variables()

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

gather_pairs()

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

reexports curve_interval cut_cdf_qi geom_slabinterval GeomSlabinterval geom_slab GeomSlab geom_dotsinterval GeomDotsinterval geom_dots GeomDots geom_interval GeomInterval geom_lineribbon GeomLineribbon geom_pointinterval GeomPointinterval dlkjcorr_marginal plkjcorr_marginal qlkjcorr_marginal rlkjcorr_marginal marginalize_lkjcorr parse_dist r_dist_name scale_point_colour_discrete scale_point_color_discrete scale_point_colour_continuous scale_point_color_continuous scale_point_fill_discrete scale_point_fill_continuous scale_point_alpha_continuous scale_point_alpha_discrete scale_point_size_continuous scale_point_size_discrete scale_interval_colour_discrete scale_interval_color_discrete scale_interval_colour_continuous scale_interval_color_continuous scale_interval_alpha_continuous scale_interval_alpha_discrete scale_interval_size_continuous scale_interval_size_discrete scale_interval_linetype_discrete scale_interval_linetype_continuous scale_slab_colour_discrete scale_slab_color_discrete scale_slab_colour_continuous scale_slab_color_continuous scale_slab_fill_discrete scale_slab_fill_continuous scale_slab_alpha_continuous scale_slab_alpha_discrete scale_slab_size_continuous scale_slab_size_discrete scale_slab_linetype_discrete scale_slab_linetype_continuous scale_slab_shape_discrete scale_slab_shape_continuous guide_colourbar2 guide_colorbar2 stat_slabinterval StatSlabinterval stat_dist_slabinterval StatDistSlabinterval stat_dist_halfeye stat_dist_eye stat_dist_ccdfinterval stat_dist_cdfinterval stat_dist_gradientinterval stat_dist_pointinterval stat_dist_interval stat_dist_slab stat_sample_slabinterval StatSampleSlabinterval stat_halfeye stat_eye stat_ccdfinterval stat_cdfinterval stat_gradientinterval stat_histinterval stat_slab stat_dotsinterval stat_dots stat_dist_dotsinterval stat_dist_dots stat_pointinterval StatPointinterval stat_interval StatInterval stat_lineribbon stat_dist_lineribbon dstudent_t pstudent_t qstudent_t rstudent_t theme_ggdist theme_tidybayes facet_title_left_horizontal facet_title_right_horizontal axis_titles_bottom_left to_broom_names from_broom_names to_ggmcmc_names from_ggmcmc_names point_interval qi hdi Mode hdci mean_qi median_qi mode_qi mean_hdi median_hdi mode_hdi mean_hdci median_hdci mode_hdci summarise_draws

Objects exported from other packages

combine_chains()

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

density_bins() histogram_bins()

Density bins and histogram bins as data frames

Point summaries, intervals, geoms, and stats

For the point_interval family (median_qi, etc) and various geoms and stats for visualizing posteriors, see the ggdist documentation

Deprecated functions

Deprecated functions

tidybayes-deprecated ggeye add_fitted_draws fitted_draws fitted_draws.default fitted_samples add_fitted_samples predicted_samples add_predicted_samples gather_samples gather_lsmeans_samples gather_emmeans_samples gather_terms extract_samples tidy_samples spread_samples as_sample_tibble as_sample_data_frame ungather_samples unspread_samples parameters geom_eye geom_eyeh geom_halfeyeh geom_slabh geom_intervalh GeomIntervalh geom_pointintervalh GeomPointintervalh geom_dotsh geom_dotsintervalh stat_dist_eyeh stat_dist_halfeyeh stat_dist_slabh stat_dist_intervalh stat_dist_pointintervalh stat_dist_gradientintervalh stat_dist_cdfintervalh stat_dist_ccdfintervalh stat_dist_dotsh stat_dist_dotsintervalh stat_eyeh stat_halfeyeh stat_slabh stat_intervalh stat_pointintervalh stat_gradientintervalh stat_cdfintervalh stat_ccdfintervalh stat_dotsh stat_dotsintervalh stat_histintervalh point_intervalh mean_qih median_qih mode_qih mean_hdih median_hdih mode_hdih mean_hdcih median_hdcih mode_hdcih

Deprecated functions, arguments, and column names in tidybayes

predict_curve() predict_curve_density()

Deprecated: Prediction curves for arbitrary functions of posteriors