Learn R Programming

socialSim

Simulate and Analyse Social Interaction Models

The socialSim R package provides tools to simulate and analyse datasets of social interactions between individuals using hierarchical Bayesian models implemented in Stan. This packages accompanies Wijnhorst et al. (2025) EcoEvoRxiv, which details the underlying statistical models.

It enables users to generate realistic social interaction data, where individual phenotypes influence and respond to those of their partners. You can simulate a sampling design by adjusting the number of individuals, partners, and repeated dyads. The simulation framework allows control over variation in mean trait values, social responsiveness, and social impact and correlation, making it suitable for research on direct and indirect genetic effects (DGEs and IGEs) and interacting phenotypes. See ?simulate_data for a full list of adjustable parameters.

The package also provides analysis functions to evaluate model performance in terms of bias and dispersion, using both established and novel approaches to modelling social effects, including impact–responsiveness, variance–partitioning, and trait-based models.


Copy Link

Version

Install

install.packages('socialSim')

Monthly Downloads

138

Version

0.1.8

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Rori Efrain Wijnhorst

Last Published

January 30th, 2026

Functions in socialSim (0.1.8)

run_model

Fit one of the available Stan models to simulated datasets
summarise_results

Summarise bias and dispersion (MADm) across simulated fits
simulate_data

Simulate social interaction datasets