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.