Skip to content

ctross/STRAND

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STRAND

Social network analysis and simulation in R using Stan

logo

STRAND is an R package designed for simulation and analysis of network data. The package can be used to simulate network data under stochastic block models, social relations models, and latent network models. These tools allow for simulation not only of realistic human and animal social networks, but also allow researchers to simulate the effects of potential biases—like respondents falsely reporting ties or failing to recall real ties—on network level properties.

STRAND also allows users to conduct data analysis. Users can specify complex Bayesian social network models using a simple, lm() style, syntax. Single-sampled self report data can be modeled using stochastic block models or the social relations model, with or with-out covariates. Double-sampled network data can be modeled using a latent network approach that accounts for inter-respondent disagreement. Here we provide a brief overview of a workflow. For further details on any step, see our full publication in X at <>.

STRAND is part of an ecosystem of tools for modern social network analysis. DieTryin is a companion package designed to facilitate the collection of roster-based network data, and to run network-structured economic games. ResolveR (currently under development) is a package for semi-supervised data cleaning, de-duplication, and record linkage.

Install:

Install by running on R:

################################### Install and/or load
 library(devtools)
 install_github('ctross/STRAND')
 library(STRAND)

You will need to have cmdstanr and rstan installed.

Quickstart guides for these packages can be found here, for cmdstanr and here, for rstan.

STRAND calls Stan models in the background, so you will need a C++ compiler in your toolchain. Users frequently rely on RTools.

Finally, we note that some users will see a warning message: "Declaration of arrays by placing brackets after a variable name is deprecated and will be removed in Stan 2.32.0." This message is ignorable, we will update the Stan code inside STRAND once deprication occurs at Stan 2.32.0.

Use:

Example models, with test data, can be found here. Note that analysis of large network data sets can be quite slow using MCMC.

Binary outcomes (runs in about 2 hours): Bernoulli models

Binomial outcomes (runs in about 2 minutes): Binomial models

Count outcomes (runs in about 20 seconds): Poisson models

Double-sampled binary outcomes (find out for yourself): Latent network models

An example on both simulating and fitting networks (includes interactions): Interaction models

An example on changing default priors: Changing priors

Note: each of the models included in this package have been fit to real emprical datsets, and tested across a wide-range of simulated data to ensure their quality. However, this package is still rather new. If you come across any weird behavior, or notice any bugs, please open an issue, and we will work to address it!

About

Social network analysis in R and Rstan

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published