DOI: 10.5061/dryad.m0cfxpp7s
title: Data and code for: Generation and applications of simulated datasets to integrate social network and demographic analyses

description: Social networks are tied to population dynamics; interactions are driven
 by population density and demographic structure, while social
 relationships can be key determinants of survival and reproductive
 success. However, difficulties integrating models used in demography and
 network analysis have limited research at this interface. We introduce the
 R package genNetDem for simulating integrated network-demographic
 datasets. It can be used to create longitudinal social networks and/or
 capture-recapture datasets with known properties. It incorporates the
 ability to generate populations and their social networks, generate
 grouping events using these networks, simulate social network effects on
 individual survival, and flexibly sample these longitudinal datasets of
 social associations. By generating co-capture data with known statistical
 relationships it provides functionality for methodological research. We
 demonstrate its use with case studies testing how imputation and sampling
 design influence the success of adding network traits to conventional
 Cormack-Jolly-Seber (CJS) models. We show that incorporating social
 network effects in CJS models generates qualitatively accurate results,
 but with downward-biased parameter estimates when network position
 influences survival. Biases are greater when fewer interactions are
 sampled or fewer individuals are observed in each interaction. While our
 results indicate the potential of incorporating social effects within
 demographic models, they show that imputing missing network measures alone
 is insufficient to accurately estimate social effects on survival,
 pointing to the importance of incorporating network imputation approaches.
 genNetDem provides a flexible tool to aid these methodological
 advancements and help researchers test other sampling considerations in
 social network studies.
description: The dataset and code stored here is for Case Studies 1 and 2 in
 the paper. Datsets were generated using simulations in R. Here we provide
 1) the R code used for the simulations; 2) the simulation outputs (as .RDS
 files); and 3) the R code to analyse simulation outputs and generate the
 tables and figures in the paper.
description: All simulations and analysis are conducted in R
 using the following (additional) packages: <em>genNetDem, igraph,
 asnipe, sna, tnet, car, boot, Matrix, MASS, MCMCvis, nimble, tidyr, readr,
 viridis, HDInterval, emdist, knitr, kableExtra, magrittr</em>, and
 <em>flextable</em>. <strong>Case Study
 1:</strong> The
 CreateParameters.R script generates the parameters1.RDS file used in the
 simulations. Simulations are conducted using the
 SimulationScript3.R script and simulation results used in the paper are
 stored in the Results folder. Data
 analysis and visualization are done using the datavis_final.R script, and
 tables are produced are stored in the Outputs
 folder. <strong>Case Study
 2:</strong> The
 CreateParameters.R script generates the parameters2.RDS file used in the
 simulations. Simulations are conducted using the
 SimulationScript2.R script and simulation results used in the paper are
 stored in the Results folder. Data
 analysis and visualization are done using the datavis_final.R script, and
 tables are produced are stored in the Outputs
 folder.