Skip to content

michaelchimento/STbayes

Repository files navigation



banner

STbayes is an R package for building, fitting and interpreting Bayesian network-based diffusion analyses (NBDA). NBDA models are generally used to identify i) whether social transmission is occurring, ii) correlates of asocial learning and social transmission, iii) pathways of transmission. An overview of the package is now published as an application article in Methods in Ecology and Evolution.

Installation

STbayes depends on cmdstanr, posterior, bayestestR, data.table and loo. You can install cmdstanr by following these instructions. Vignettes use NBDA (install with devtools::install_github("whoppitt/NBDA"), igraph, dplyr, ggplot2, and ggpubr.

To install STbayes:

# install devtools if not already
if (!require("devtools")) install.packages("devtools")
devtools::install_github("michaelchimento/STbayes")

Citing STbayes

Chimento, M., & Hoppitt, W. (2025). STbayes: An R package for creating, fitting and understanding Bayesian models of social transmission. Methods in Ecology and Evolution, 00, 1–10. https://doi.org/10.1111/2041-210x.70228.

Getting started

Advanced recipes

Simulating data for power analyses

Features:

  • TADA (acquisition time known) and OADA (only acquisition order known) model types.
  • static and dynamic networks.
  • multi-network comparison (with static or dynamic networks).
  • multiple trials with the same set, subsets, or different sets of individuals.
  • constant and time-varying ILVs for additive and multiplicative transmission models.
  • varying effects by individual, by trial, or by both for any parameter.
  • easy workflow for ELPD (loo-psis, waic) model comparison.
  • propagation of uncertainty from network measures to transmission model
  • modeling of complex transmission and contagion

About

An R package for creating and running Bayesian models of social transmission.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published