Introduction

This guidebook provides a comprehensive overview of how to estimate social animal models (SAMs) with the Stan statistical programming language (Carpenter et al. 2017) in R (R Core Team 2020). A detailed theoretical treatment of SAMs and their empirical motivation can be found in the forthcoming paper (Martin and Jaeggi 2021) “Social animal models for quantifying plasticity, assortment, and selection on interacting phenotypes.” This guide focuses on various issues related to coding SAMs in Stan for varying study designs and more complex trait interactions. The overarching goal of the guidebook is to aid researchers in flexibly and appropriately applying SAMs to their own empirical datasets. Therefore, in addition to basic coding tutorials, we also intend to add worked examples relevant to specific challenges such as modeling spatial autocorrelation or hierarchical phenotypes.

Please contact Jordan Scott Martin if you have any questions, as well as if you’d like to suggest a worked example of interest to your own research. The guidebook is a work in progress and will be updated over time.

Resources

Carpenter, B., A. Gelman, M. D. Hoffman, D. Lee, B. Goodrich, M. Betancourt, and... A. Riddell. 2017. “Stan: A Probabilistic Programming Language.” Journal of Statistical Software 74. https://www.jstatsoft.org/article/view/v076i01.
Martin, J. S., and A. V. Jaeggi. 2021. “Social Animal Models for Quantifying Plasticity, Assortment, and Selection on Interacting Phenotypes.” Journal of Evolutionary Biology. https://doi.org/10.1111/jeb.13900.
R Core Team. 2020. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org.