Abstract
Animal social networks are often constructed from point estimates of edge weights. In many contexts, edge weights are inferred from observational data, and the uncertainty around estimates can be affected by various factors. Though this has been acknowledged in previous work, methods that explicitly quantify uncertainty in edge weights have not yet been widely adopted, and remain undeveloped for many common types of data. Furthermore, existing methods are unable to cope with some of the complexities often found in observational data, and do not propagate uncertainty in edge weights to subsequent statistical analyses.
We introduce a unified Bayesian framework for modelling social networks based on observational data. This framework, which we call BISoN, can accommodate many common types of observational social data, can capture confounds and model effects at the level of observations, and is fully compatible with popular methods used in social network analysis.
We show how the framework can be applied to common types of data and how various types of downstream statistical analyses can be performed, including non-random association tests and regressions on network properties.
Our framework opens up the opportunity to test new types of hypotheses, make full use of observational datasets, and increase the reliability of scientific inferences. We have made both an R package and example R scripts available to enable adoption of the framework.
Keywords: animal social network analysis, Bayesian inference, nodal regression, dyadic regression, network metrics
Introduction
Social network analysis is arguably one of the most popular frameworks in the study of sociality (Croft, Darden, and Wey 2016). In many scientific contexts, network connections (edges) are inferred from observational data, such as human observers recording social interactions between monkeys or biologgers capturing proximity events between people. The type of data used to infer networks and the manner in which the data are collected affects both the interpretation of social network analyses and their accuracy (Whitehead 2008a).
Networks are usually constructed by taking a normalised measure of sociality, such as the proportion of sampling periods each pair spends engaged in a social behaviour (e.g. the Simple Ratio Index; SRI) (Cairns and Schwager 1987). These normalised measures ensure that pairs that are observed for longer are not erroneously determined to be more social (Whitehead 2008a). This is important because observing social events can be challenging and uniform sampling over all pairs is not always possible (Croft, James, and Krause 2008). Though normalised measures of social structure will not be biased by sampling time, they will be accompanied by varying levels of certainty. For example, edge weights will be treated as a certain 0.5 for both a case where individuals have been seen together once and apart once, and equally where individuals have been together 100 times and apart 100 times. Existing solutions to this problem aim to either a priori quantify accuracy and power of social networks (Whitehead 2008b; Jordan D. A. Hart et al. 2021); filter out highly uncertain data points (James, Croft, and Krause 2009); or include sampling effort as terms in statistical models (Franks et al. 2021). These existing solutions can be useful, but also necessarily lose information and may introduce biases into analyses. Though uncertainty is likely present in most measurements (e.g. age, size, or perhaps even sex), the above-mentioned studies have highlighted that uncertainty due to sampling effort can be orders of magnitude greater than other sources of measurement uncertainty. Any major sources of uncertainty can drastically impact the performance of statistical models, so it is important that uncertainty due to sampling effort is accounted for properly (Wasserman 2004). Despite this, methods to fully estimate and propagate uncertainty through social network analyses remain largely underdeveloped.
In this paper we introduce BISoN: a general unified Bayesian framework for modelling social network data. BISoN captures uncertainty in edge weights, making full use of available data; propagates uncertainty through downstream analyses; and can control for social and non-social effects at any level (individual, dyad, group, observation, etc). Any type of social network analysis can be conducted within our framework, including dyadic and nodal regressions, non-random edge weight tests, and estimation of structural network properties. The BISoN framework comprises a) an edge weight model, dependent on data type, that builds edge weights and networks with uncertainty from empirical data, and b) downstream analyses that use estimated edge weights to take into account uncertainty in the network. This manuscript is intended as a technical overview of BISoN, and assumes some familiarity with the main concepts of Bayesian statistics and social network analysis. Readers unfamiliar with the Bayesian statistical workflow and social network analysis are directed to introductory texts such as (Kruschke 2015; McElreath 2020; Carrington, Scott, and Wasserman 2005) and (Croft, James, and Krause 2008). We will focus on how our framework can be applied to animal systems, but the underlying principle can be applied to any type of network analysis where network edges are inferred. The BISoN framework presents an opportunity to generate reliable, flexible, and rich scientific inference in the study of social systems.
BISoN - Bayesian Inference of Social Networks
In the following section we outline the three edge weight models we have developed for binary, count, and duration data (see Table 1 for definitions of these types of data). For brevity, the models are presented without detailing any specific priors, but when fitting these models, priors should always be specified, and the choice of prior should depend on the context and the question in hand (Schoot et al. 2021). These edge weight models can be used to generate estimates for network edge weights . We describe how to obtain edge weight estimates for binary, count and duration data below. Once estimates for edge weights are obtained, they can be used in downstream analyses. We will briefly outline three types of analyses that propagate uncertainty through the analysis. These analyses are: 1) testing for non-random edge weights, 2) dyadic regression, and 3) nodal regression. When presenting the downstream analyses, for brevity we will refer to them in the context of the count data model, but these downstream analyses are freely applicable to all types of data. An overview of the BISoN modelling workflow is shown in Figure 1. The models we present here are simple examples that can be extended and refined in many ways. These methods will be useful and reliable, providing they are used appropriately in the context of the data, the scientific question, and with appropriate diagnostic tools (Kruschke 2015; McElreath 2020). We have released an R package to enable most common types of model and analysis to be used by researchers, at: https://doi.org/10.5281/zenodo.7611719 (Jordan D. A. Hart et al. 2022). We have also provided example code for users wishing to develop advanced bespoke models, at: https://doi.org/10.5281/zenodo.6603327.
Table 1:
Definitions of the three types of social observational data we have developed models for. Examples of standard edge weight interpretations are included in the third column.
| Data type | Description | Edge interpretation |
|---|---|---|
| Binary | The presence or absence of a social event for each dyad is recorded in each sampling period. | Probability of (or proportion of time) engaging in a social event in a fixed period of time. |
| Count | The number of social events for each dyad is recorded in each sampling period. | Rate of occurrence of social events per unit time. |
| Duration | The amount of time each dyad spends engaged in a social event is recorded in each sampling period. | Proportion of time spent engaging in a social event. |
Figure 1:

Schematic overview of the BISoN framework. Different types of observation data in various levels of aggregation are fed into the appropriate edge weight model for the type of data. The edge weight model generates posterior distributions over edge weights, quantifying uncertainty over them. Posterior edge weights can be visualised in a sociogram with uncertainty, or extracted as an edge list with credible intervals. Posterior edge weights can also be extracted for downstream analyses such as regression analyses, non-random edge weight tests, and more.
Quantifying uncertainty in edge weights
Edge weight model: Binary data
To demonstrate the notion behind BISoN, we will first describe the edge weight model for the case of binary data. We define binary data as the case where presence or absence of a social event per fixed sampling period is recorded. First, note that for binary data, edge weights are commonly defined as:
where is the number of presence/absence social events that occurred between and , and is the number of sampling periods where it is considered possible for a social event to have been observed between and . The exact definition will depend on context, but this may often be the number of periods in which at least one of the individuals of the dyad was seen.
The edge weight is therefore equivalent to the probability of and engaging in a social event in any given sampling period. This can also be interpreted as an estimate of the proportion of time and spend engaging in a social event. Let us refer to this probability (or proportion) as . Without making any additional assumptions beyond that of the standard SRI calculation, an equivalent formulation is:
Note that the maximum likelihood estimate for in this process is . The binomial process is the natural process for multiple Bernoulli trials, which makes this formulation a natural extension of point estimates for edge weights. In a Bayesian context, the parameter is treated as a random variable, and inherently captures any uncertainty around its value. A similar formulation was used by (Farine and Strandburg-Peshkin 2015) to estimate uncertainty over edge weights using a beta conjugate prior over the parameters (as detailed in (Fink 1997)).
Social data can sometimes be influenced by non-social effects at the observation level. For example, varying levels of habitat visibility depending on location, variance in observer reliability, or time of day can all affect the recorded observations of social events. These effects cannot be modelled by aggregating social events at the dyad level. To solve this, we propose to model these effects by decomposing the binomial process over the aggregated observations to distinct Bernoulli processes over unaggregated observations, as follows:
where is the probability of a social event occurring between and in the -th observation of and , and is the edge weight between and . The ellipsis represents additional terms that can be included (if desired) to model various effects. The term can be seen as analogous to the predictor terms in regression models. In the location-dependent visibility example, including an observation-level location effect will account for this visibility effect. When additional effects are included, the edge weight will become an estimate of relative sociality in the presence of non-social effects. We use a linear combination of effects in these examples for simplicity, but the effects could equally be modelled as non-linear functions if deemed necessary in context. Alternatively dyad- or individual-level effects can also be included to separate out different types of social effect.
The binary data model can also be used for group-based (gambit of the group) data (Whitehead and Dufault 1999). If being used for group data, an additional term in the model can be used to account for non-independence within group observations. See the supplementary material (S1) for further discussions on these points.
Edge weight model: Count data
The same concept as above can also be applied to the case of count data, where counts of social events between individuals per sampling period are recorded. First, note that for count data, point estimates of edge weights are often also defined as but where is the total number of social events that occurred between and , and is the total amount of time a social event could have been observed between and .
The edge weight is therefore equivalent to the rate at which and engaged in a social event per unit time. Let us refer to this rate as . When events occur with a fixed rate, the number of events expected per unit time is described by the Poisson process (Wasserman 2004). Since we assume that the rate of events characterises edge weights well, then without making any additional assumptions, we can model social events as:
where is the underlying rate parameter. When modelled in a Bayesian framework, this provides a natural way to model the uncertainty around edge weights because the maximum likelihood estimate for is (Held and Sabanés Bové 2014).
Again, this model doesn’t allow observation-level effects to be modelled, so we must decompose the aggregated data into the original sampling periods. Fortunately, the sum of Poisson-distributed random variables is also described by a Poisson distribution. This means that the full model can take a similar form to the previous model:
where is the rate at which social events occur between and in the -th observation of and , is the length of time of the -th sampling period for the dyad, and is again the edge weight between and . As above, the ellipsis represents potential additional effects that could be included in the model if necessary. This is discussed in a later section and in the supplementary material (S2).
Edge weight model: Duration data
The edge weight model for duration data is slightly more complex than those of the binary and count data models, because it models two different types of data simultaneously: the duration of social events, and the frequency with which they occur. With duration data, the edge weight is again calculated using , but where is the amount of time and were seen engaged in a social event, and is the maximum amount of time and could have been seen engaged in a social event. The total amount of time is the sum of times from social events. The edge weight is then modelled as the proportion of time each dyad could engage in a social event that is actually spent engaging in the social event:
where is the mean event duration for the dyad and is the mean rate of events per unit time for the dyad. Inter-arrival times in a Poisson process are distributed according to the exponential distribution, so we use this to model the duration of social events once they have started. The count of events can again be considered to be a Poisson process. Bringing these two assumptions together gives the following model (see supplementary material (S2) for the full derivation):
The mean event time is modelled inherently in and can be recovered from the fitted model afterwards using .
Accounting for social and non-social effects
By modelling social events at the observation-level rather than the dyad-level, it is possible to account for observation-level effects that may influence the estimated edge weights. An example of this is where the study population might move through various locations with different visibilities, leading to location-dependent missed social events. Assuming that variation in sociality between location isn’t of direct interest to the researcher, we can include a location effect in the model. An example of how this can be achieved in the count model is:
where is a location effect corresponding to the location of the social events observed for the dyad in the -th observation period. The location effect has an adaptive normal prior centered at zero (often known as a random effect). The location effect is designed to capture the differences in visibility at different locations. Note that if more direct information such as vegetation density is available that can directly model, for example, visibility, this will always be preferable to weaker proxy variables. In theory, the effect of visibility on edge weights will always be negative, but we choose to model it without bounds. This is because the true visibilities in different locations are unknown, so the edge weights cannot be estimated exactly, only proportionally. It is therefore unnecessary to place an upper bound on the visibility effect, making the model easier to fit.
Depending on the assumed causal process that generates observations, it won’t always be possible to control for non-social effects in this way, as the social effect of interest may partially be borne out through apparent non-social effects, such as space use. For example individuals may genuinely be more social in some locations than others, and controlling for location would remove the social effect of interest. A discussion on the the considerations around modelling non-social effects is included in the supplementary material (S7).
Downstream analysis with uncertainty
The previous section has shown how uncertainty can be estimated over edge weights. Once these estimates have been obtained, it is then possible to conduct various types of statistical analysis on the network while propagating uncertainty through the entire analysis. This approach will lead to lower ‘false positive’ error rates because network quantities will have higher variances. Despite this, because the uncertainty captured by BISoN reflects true uncertainty in the data, it will also have a ‘false negative’ error rate no higher than comparable analyses that do not quantify uncertainty. In this section we will discuss how several common types of social network analysis can be applied to social networks constructed with BISoN edge weight models. In particular we outline how three specific types of network analysis can be conducted: 1) testing for non-random edge weights, 2) dyadic regression, and 3) nodal regression.
Testing for non-random edge weights
BISoN enables a Bayesian test analogous to the classic non-random association test developed by (Bejder, Fletcher, and Bräger 1998) from a species cooccurrence test developed by (Manly 1995), and originally proposed as the ‘chance sociogram’ by (Moreno and Jennings 1938). At its core, this test asks whether the structure of an observed network is an artefact of sampling alone or if there is genuine variation in edge weights between individuals. If the structure of an observed network is simply due to sampling, then there is no variation in edge weight, and each dyad is equally likely to engage in social events as all other dyads. In BISoN, this is equivalent to
where is now a single edge weight parameter shared between all dyads, indicating no variation in underlying edge weights between dyads. This model constitutes the null hypothesis of random edge weights. This can be compared to the alternative hypothesis of non-random edge weights, where the parameter is replaced with a dyad-level parameter , allowing each dyad to exhibit a different edge weight. In a Bayesian context, these two models ( vs ) can be compared using the Bayes factor. Instead of attempting to reject the null model, as in null hypothesis significance testing, the Bayes factor quantifies the support for or against the hypotheses. The Bayes factor in favour of over is defined as:
where and denote the probability of the alternative hypothesis and the null hypothesis given the data respectively. and are known as the marginal likelihoods, and can be estimated numerically from a fitted model (Gronau et al. 2017). The Bayes factor can be directly interpreted as the relative likelihood of the competing hypotheses. For example, a Bayes factor of 5 in favour of over would indicate that is 5 times more likely than given the data and model. A useful property of Bayes factors is that they can quantify support for or against hypotheses, and can even be used to compare multiple hypotheses.
The original test from (Bejder, Fletcher, and Bräger 1998) is extendable to test for non-random associations within categories (such as sex combination or age difference). However, it requires continuous variables such as age difference to be discretised into categories. Discretising variables is generally not ideal, and removes information, weakens statistical power, and can lose useful insights (Altman and Royston 2006). Our proposed test can account for variables such as age without discretisation. This can be achieved by adding variables to the predictor in the following way:
where is a parameter describing the effects of age on the log rate of social events, and is the age difference for the dyad . In addition to modelling continuous variables, this approach to the non-random edge weight testing also makes it possible to compare multiple competing hypotheses of edge structure, model the effects of different dyad-level covariates, and compare hypotheses relating to global network metrics such as network density or clustering coefficients.
Dyadic regression
A common type of analysis in studies of social networks is to consider factors that affect edge weights. This type of analysis is often called dyadic regression, where explanatory factors such as sex or age difference are regressed against edge weight. The edge weights in dyadic regression are non-independent, as variables such as age difference or sex difference are inherently linked to individual-level attributes. This means that effects due to age or sex in individual affect all dyads that connect . This non-independence can be controlled for by including node-level effects in the regression (Tranmer, Steel, and Browne 2014).
Using the count data example discussed earlier, we propose to conduct dyadic regression using a standard regression model of the form:
where is the intercept parameter, is the slope parameter, are parameters accounting for the effect of some edges sharing the same node, is the standard deviation of the residuals, and is a hyperprior for the standard deviation of the edge-sharing effect (undefined here to avoid suggesting a default prior). The parameters are used to capture non-independence of dyads, and are sometimes known as multi-membership effects (Tranmer, Steel, and Browne 2014). Further discussion of multi-membership models in social network analysis can be found in (J. D. Hart et al. 2021). The dashed line indicates that the model can be fit in two separate parts: the first part being the edge weight model, and the second part being the dyadic regression model. It is not strictly necessary to separate out the model like this, but doing so makes it possible to fit the edge weight model once and conduct multiple types of analysis on it afterwards without fitting the entire model again. The and parameters can be interpreted in the same way as usual regression coefficients, and will be accompanied with posterior distributions describing plausible values of the coefficients.
The model shown here is intended as a minimal example of a simple linear regression with node-level effects to account for the non-independence of edges. The regression can be extended to support different family distributions, hierarchical effects, non-linearities, and more. We have included examples of diagnostics and some extensions in the example code.
Nodal regression
The final common type of network analysis we will cover here is nodal regression, where a regression is performed to analyse the relationship between a nodal network metric (such as centrality) and nodal traits (such as age and sex). These analyses are usually used to assess how network position depends on various biological factors, but can also be used where network position is a predictor. Since node metrics are derivative measures of the network, uncertainty in edge weights should ideally propagate through to node metrics, and on to coefficients in regression analyses, giving an accurate estimate of the total uncertainty in inferred parameters. The core of the nodal regression is similar to dyadic regression, taking the form:
where is the intercept parameter, is the slope parameter, and is the standard deviation of the residuals. denotes the node metric estimates when applied to the edge weights estimated in the top part of the model.
Calculating node metrics within the model may present a practical challenge when using standard model fitting software, as many node metrics can not be described purely in terms of closed-form equations (Freeman 1978). In this case, splitting up the model along the dashed line becomes an important step, as it allows the edge weights to be estimated using a standard piece of software, and leaves the regression part of the model to be fit using a sampler that supports numeric estimates of network centralities. As part of the code we have made available, we have written a custom Metropolis-Hastings sampler that maintains the joint distribution of edge weights, rather than sampling edge weights independently. This ensures that the effect of any structure in the observation data (such as location effects) is maintained and propagated through to the node metric estimates, and subsequently to regression coefficient estimates.
Example: Synthetic dataset
To demonstrate our framework, we present an example based on a synthetic dataset of social events simulating count data. The synthetic dataset was generated by assigning underlying undirected edge weights to 28 dyads corresponding to all possible pairs of 8 individuals living in a closed social group. Individuals 1 - 4 were assigned to a treatment condition and individuals 4 - 8 were assigned to a control. Dyads between two individuals within the treatment condition were assigned a higher edge weight than other dyads, to induce an effect of treatment condition on centrality. Social events were simulated from a Poisson point process based on both the underlying edge weight and an observation-level, non-social effect of location. There were 6 possible locations for observations of social events that were used to simulate the effect of varying visibilities in different locations. Between 10 and 50 observation periods of fixed length (arbitrary time units) were simulated for each dyad. Full details of the simulation can be found in the example code.
The synthetic dataset describes the count of events for each observation period, therefore the appropriate model for this data is the count model. The full model was defined as:
where is the count of social events between and in their -th observation period, is the social event rate from the corresponding period, is the length of the corresponding sampling period (fixed to 1 here for simplicity), is the dyad-level edge weight, and is an observation-level effect corresponding to one of the 6 locations. The prior distributions were chosen using a prior predictive check to ensure the parameters only take on biologically plausible values. The model was implemented in Stan, and fitted in R, using the package Rstan (R Core Team 2020; Stan Development Team 2020). Other approaches such as integrated nested Laplace approximation (INLA) may also be used, see the supplementary material for a brief discussion of available fitting algorithms (S6) (Rue, Martino, and Chopin 2009).
The model fit was checked visually by examining the chains and computing the Gelman-Rubin convergence statistic (Gelman and Rubin 1992). Once the model fit was verified, the parameter estimates of edge weights between dyads were extracted. Figure 2A shows a sociogram visualisation of the network based on edge weight estimates , where the bands around edges are proportional to the widths of the 95% credible intervals. At this point the estimated network can be treated much the same as a standard network of point estimates, as long as care is taken to preserve uncertainty through subsequent analyses. To demonstrate the power of BISoN for conducting downstream analyses, we conducted a regression analysis where the response was eigenvector centrality and the predictor was a categorical variable with two categories, representing the treatment condition. To improve model fit, the response was standardised by subtracting the mean and dividing by the standard deviation. The model specification for the regression analysis was:
where denotes the standardised eigenvector centrality for the -th node, is the effect parameter corresponding to the treatment condition (control or treatment) for the -th sample, and is the standard deviation of the residuals. The regression model was fit using our custom Metropolis-Hastings sampler and chain convergence was checked visually and with the statistic. Posterior predictive checks were used to ensure the model fitted the data well.
Figure 2:

A) Sociogram visualisation of a network generated from uncertain edge weights. The width of edges denotes their weights, and the bands around the edges are proportional to the width of their 95% credible intervals. Low edge weights are arbitrarily removed from this plot (though not the analysis) for visualisation purposes. B) Posterior distributions of node-level eigenvector centralities for each node in the network. Nodes 1 - 4 are those assigned to the treatment, and nodes 5 - 8 to the control.
The posterior distributions of unstandardised eigenvector centralities for the 8 nodes are shown in Figure 2B. The treatment condition parameters are interpretable as the mean standardised eigenvector centrality of nodes for each of the two conditions. The 95% credible interval for the control parameter was [−1.27, −0.36], with a median of −0.83, and for the treatment parameter was [0.35,1.29], with a median of 0.85. One of the many benefits of Bayesian inference is that posterior distributions of different parameters can themselves be used gain statistical insights. In this case, the question of real interest is the difference between the two treatment conditions: . This quantity can simply be calculated by subtracting the posteriors corresponding to the treatment parameter from those corresponding to the control parameter. We found that the difference in standardised centrality between treatment conditions, , had a 95% credible interval of [0.99,2.33] and a median of . The posterior distribution of the difference is also shown in Figure 2B. This indicates that the treatment condition appears to correlate strongly with a higher centrality.
This brief example outlines just some of the types of analysis that can be carried out in our framework. We have included several additional examples in the code included with this paper.
Example: Southern resident killer whales
To demonstrate BISoN on empirical data, we used a publicly-available dataset of near-surface physical contact interactions between 22 southern resident killer whales (Orcinus orca) (Michael N. Weiss et al. 2021). We fitted a BISoN count edge model to the data and ran a regression analysis to study the associations between node strength and both age and sex. See supplementary (S4) for replicable code of this analysis. We opted for a standard linear model with a Gaussian family distribution, implemented using the bison_brm function in bisonR. From previous work we expected a negative association between node centrality and age, and we also expected males to be less central than females (Michael N. Weiss et al. 2021). Our findings were in line with this, and we found a negative association of age with centrality, with an estimated age coefficient of −0.57 (95% CI: −0.80, −0.35). We also found that males had a lower centrality than females, with an estimated sex coefficient of −9.99 (95% CI: −15.32, −4.67). We hope this findings serve as a useful empirical example of how BISoN can be used to run regression analyses.
Discussion
In this paper we presented BISoN, a general, highly flexible framework for modelling and analysing social networks. BISoN uses models of data collection processes to quantify uncertainty in edge weights. These models are versatile, and can be extended to capture additional social and non-social effects. We demonstrated how uncertainty in the network can then be propagated through to subsequent analyses, such as regressions involving network centrality. We have provided example code for how to implement the BISoN framework in R with Stan at: https://doi.org/10.5281/zenodo.6603327.
BISoN acknowledges the inherent uncertainty in inferred edge weights, and by propagating this through downstream analyses can offer nuanced, balanced, and powerful statistical analyses, focused on quantifying biological effects and the uncertainty around them. As well as propagating uncertainty into downstream analyses, the edge weight model itself can also be adapted to ask questions about individual variation in gregariousness, reciprocation of directed behaviours, and underlying differentiation of edge weights, among many others (see the supplementary material (S3) for further information).
We see BISoN as a generalised synthesis and extension of a wide range of existing methods. In particular, for binary data, BISoN implements a variant of the beta binomial measurement error model, which has been previously used in animal social network analysis (Fink 1997; Fuller 1987; Farine and Strandburg-Peshkin 2015). BISoN’s mechanism for modelling multiple effects was inspired by generalised linear models, and can be seen as an extension of social relations models (Kenny and La Voie 1984; McCulloch and Searle 2004). This concept was introduced to the animal social network literature by (Whitehead and James 2015) as generalised affilitation indices. The BISoN framework shares some conceptual similarities with the recently developed STRAND framework, but implements measurement models specifically designed for common types of empirical data, and allows propagation of uncertainty to downstream analyses (Redhead, McElreath, and Ross 2021).
One of the main benefits of our framework is its inherent flexibility, but this also introduces a number of considerations when using it. Setting priors is an important part of Bayesian modelling, and it is important that they reflect realistic prior expectations of parameter values (Schoot et al. 2021). The priors included in the example code are not intended as good defaults, and instead the priors should be determined by careful consideration of the meaning of the parameter, prior expectations of likely values for the parameter, and using prior predictive checks (Conn et al. 2018). It is also important to note that using additional terms and altering the predictor part of the model can change the interpretation of model parameters, which may require the priors to be altered as well.
Another consideration is that network centrality measures based on binarised edges, such as degree and transitivity, have a slightly different interpretation in this framework. This is because, even though a particular dyad may never have been seen interacting in, say 100 samples, it is still possible that they would interact in the the 101st sample. The edge weight models BISoN uses naturally acknowledge this, so there is uncertainty around all edge weights. If binarised centralities are needed, there are two possible ways to use them in BISoN: 1) the edge weights can be thresholded, to generate a binary distribution on 0 and 1 for each edge; or 2) the edge weights can be assigned to categories, and membership of a specific category (e.g. weak or strong) becomes the new binary measure, again maintaining uncertainty over the membership. Option 1 can simply be applied to the sampling posterior by choosing a biologically relevant cut-off point and applying the threshold. In some cases this approach may prove challenging because it requires mapping domain knowledge and the question, in context, to a single threshold point for the analysis. Option 2 requires partial pooling over edge weights, assuming that they are drawn from a mixture of distributions, and assigns each edge weight to each type of connection with a certain probability. This approach is conceptually similar to the social bond categorisation method introduced by (Ellis et al. 2021). If it is biologically sensible to believe there are different categories of connections in a system, this can provide a natural and principled way to compute binary network measures (see supplementary material (S5) for an example of how to do this).
A final consideration of our modelling framework is that, though non-social effects can be modelled in the predictor, this alone cannot remove some non-social effects, and could instead absorb the social effect of interest, depending on the underlying causal system. We recommend that these effects be treated with caution, and used only with explicit assumptions about the underlying causal system. These considerations are also discussed in further depth in the supplementary material (S7) using causal models.
The versatility of our proposed framework makes the approach powerful, but comes with a number of limitations. Though highly flexible, one important constraint on BISoN is that knowledge of sampling effort will be required to properly model the processes that generate observations. On a practical level, BISoN models will usually need to be fit using a Markov chain Monte Carlo (MCMC) sampler. MCMC can be slow and computationally expensive, especially with large datasets. If additional effects are not included, this issue can be partially overcome by aggregating data at the dyad-level and fitting collapsed versions of the models (see supplementary materials (S8)). Furthermore, MCMC methods do not guarantee convergence, so additional checks will be required to make sure the sampler has performed correctly (Cowles and Carlin 1996; Draper 2008). Together these limitations make the process of model building, fitting, and checking a more complex undertaking than simply building networks from point estimates. However, in return for these investments, researchers will have access to a powerful suite of tools that can make maximum use of hard-won data.
The BISoN framework is open-ended and can be extended in many ways. One particularly useful aspect of the Bayesian approach is the ability to treat data with uncertainty. This allows missing data to be modelled within the statistical model without the need for repeated model fitting routines. Furthermore, missing data can be estimated from other variables, which could be especially useful in populations where traits such as age are often estimated or unknown (Little and Rubin 2002). Another potential direction for the framework is to move beyond static sociality measures and instead explicitly model the dynamics of edge weights, as discussed by (Pinter-Wollman et al. 2014). Dynamic edge weights could be modelled by incorporating autoregressive time series models into the framework (Wei 2013). This would make it possible to model the general trends in edge weights, how changes in edge weights propagate through the network, and even model flow processes such as disease or information transmission.
Conclusion
Uncertainty affects all social network analyses, yet until now has been difficult to quantify. The BISoN framework we have introduced is designed to help quantify uncertainty and ensure it is preserved through subsequent analyses to give robust and reliable statistical inference. Our framework is general and widely applicable to almost any type of social relational data. Estimated edge weights from our models can be used with many different types of downstream analysis while propagating uncertainty. We believe the ideas presented in this paper are only the first step in developing powerful, flexible, and robust statistical models for social networks. BISoN has the potential to enable us to ask a wide range of nuanced questions, and obtain a deeper insight into the nature of sociality.
Supplementary Material
Acknowledgements
The authors would like to thank Rebecca Padget, Josefine Bohr Brask, Delphine De Moor, Samuel Ellis, Kenneth Keuk, Mario Angst, and members of the CRAB social network club for useful discussions on early versions of the manuscript.
JDAH acknowledges funding from the Engineering and Physical Sciences Research Council [grant number EP/R513210/1]. LJNB acknowledges funding from a European Research Council Consolidator Grant (FriendOrigins - 864461) and from the National Institute of Health (R01AG060931, R01MH118203). DWF and MNW acknowledge funding from the Natural Environment Research Council [grant number NE/S010327/1]. DWF also acknowledges funding from the Natural Environment Research Council [grant number NE/S009914/1].
Footnotes
Conflict of interest
The authors declare no conflict of interest.
Contributor Information
Jordan D. A. Hart, University of Exeter - Department of Psychology, Washington Singer Building Perry Road Exeter, Exeter, Devon EX4 4QJ, United Kingdom of Great Britain and Northern Ireland
Michael N. Weiss, Centre for Research in Animal Behaviour, Exeter, United Kingdom of Great Britain and Northern Ireland, Center for Whale Research, Friday Harbor, United Kingdom of Great Britain and Northern Ireland
Daniel W. Franks, University of York - Biology, The University of York Heslington, York YO105DD, United Kingdom of Great Britain and Northern Ireland.
Lauren J. N. Brent, University of Exeter - Center for Research in Animal Behaviour, Exeter, United Kingdom of Great Britain and Northern Ireland.
Data availability
The BISoN example code is indexed at https://doi.org/10.5281/zenodo.6603327. The bisonR package is indexed at https://doi.org/10.5281/zenodo.7611719.
Bibliography
- Albery Gregory F, Morris Alison, Morris Sean, Pemberton Josephine M, Clutton-Brock Tim H, Nussey Daniel H, and Firth Josh A. 2021. “Multiple Spatial Behaviours Govern Social Network Positions in a Wild Ungulate.” Ecology Letters 24 (4): 676–86. [DOI] [PubMed] [Google Scholar]
- Altman Douglas G, and Royston Patrick. 2006. “The Cost of Dichotomising Continuous Variables.” BMJ : British Medical Journal 332 (7549): 1080. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1458573/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bejder Lars, Fletcher David, and Bräger Stefan. 1998. “A Method for Testing Association Patterns of Social Animals.” Animal Behaviour 56 (3): 719–25. 10.1006/anbe.1998.0802. [DOI] [PubMed] [Google Scholar]
- Cairns Sara J, and Schwager Steven J. 1987. “A Comparison of Association Indices.” Animal Behaviour 35 (5): 1454–69. [Google Scholar]
- Carrington Peter J, Scott John, and Wasserman Stanley. 2005. Models and Methods in Social Network Analysis. Vol. 28. Cambridge university press. [Google Scholar]
- Cartwright Dorwin, and Harary Frank. 1956. “Structural Balance: A Generalization of Heider’s Theory.” Psychological Review 63 (5): 277. [DOI] [PubMed] [Google Scholar]
- Conn Paul B, Johnson Devin S, Williams Perry J, Melin Sharon R, and Hooten Mevin B. 2018. “A Guide to Bayesian Model Checking for Ecologists.” Ecological Monographs 88 (4): 526–42. [Google Scholar]
- Cowles Mary Kathryn, and Carlin Bradley P. 1996. “Markov Chain Monte Carlo Convergence Diagnostics: A Comparative Review.” Journal of the American Statistical Association 91 (434): 883–904. [Google Scholar]
- Croft Darren P, Darden Safi K, and Wey Tina W. 2016. “Current Directions in Animal Social Networks.” Current Opinion in Behavioral Sciences, Behavioral ecology, 12 (December): 52–58. 10.1016/j.cobeha.2016.09.001. [DOI] [Google Scholar]
- Croft Darren P, James Richard, and Krause Jens. 2008. Exploring Animal Social Networks. Princeton University Press. [Google Scholar]
- Doreian Patrick, and Mrvar Andrej. 2009. “Partitioning Signed Social Networks.” Social Networks 31 (1): 1–11. [Google Scholar]
- Draper David. 2008. “Bayesian Multilevel Analysis and MCMC.” In Handbook of Multilevel Analysis, edited by de Leeuw Jan and Meijer Erik, 77–139. New York, NY: Springer New York. 10.1007/978-0-387-73186-5_2. [DOI] [Google Scholar]
- Ellis Samuel, Franks Daniel W, Weiss Michael N, Cant Michael A, Domenici Paolo, Balcomb Kenneth C, Ellifrit David K, and Croft Darren P. 2021. “Mixture Models as a Method for Comparative Sociality: Social Networks and Demographic Change in Resident Killer Whales.” Behavioral Ecology and Sociobiology 75 (4): 1–15. [Google Scholar]
- Farine Damien R., and Carter Gerald G.. 2021. “Permutation Tests for Hypothesis Testing with Animal Social Network Data: Problems and Potential Solutions.” Methods in Ecology and Evolution. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Farine Damien R., and Strandburg-Peshkin Ariana. 2015. “Estimating Uncertainty and Reliability of Social Network Data Using Bayesian Inference.” Royal Society Open Science 2 (9): 150367. 10.1098/rsos.150367. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Fink Daniel. 1997. “A Compendium of Conjugate Priors.” See Http://Www.People.Cornell.Edu/Pages/Df36/CONJINTRnew%20tex.Pdf46. [Google Scholar]
- Franks Daniel W., Weiss Michael N., Silk Matthew J., Perryman Robert J. Y., and Croft Darren P.. 2021. “Calculating Effect Sizes in Animal Social Network Analysis.” Methods in Ecology and Evolution 12 (1): 33–41. https://doi.org/ 10.1111/2041-210X.13429. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Freeman Linton C. 1978. “Centrality in Social Networks Conceptual Clarification.” Social Networks 1 (3): 215–39. [Google Scholar]
- Fuller Wayne A. 1987. Measurement Error Models. John Wiley & Sons. [Google Scholar]
- Gelman Andrew, and Rubin Donald B.. 1992. “Inference from Iterative Simulation Using Multiple Sequences.” Statistical Science 7 (4): 457–72. 10.1214/ss/1177011136. [DOI] [Google Scholar]
- Gronau Quentin F, Sarafoglou Alexandra, Matzke Dora, Ly Alexander, Boehm Udo, Marsman Maarten, Leslie David S, Forster Jonathan J, Wagenmakers Eric-Jan, and Steingroever Helen. 2017. “A Tutorial on Bridge Sampling.” Journal of Mathematical Psychology 81: 80–97. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hart Jordan D A, Franks Daniel W, Brent Lauren, and Weiss Michael N. 2022. “bisonR - Bayesian Inference of Social Networks with r,” November. osf.io/ywu7j. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hart Jordan D. A., Franks Daniel W., Brent Lauren J. N., and Weiss Michael N.. 2021. “Accuracy and Power Analysis of Social Interaction Networks.” bioRxiv, January, 2021.05.07.443094. 10.1101/2021.05.07.443094. [DOI] [Google Scholar]
- Hart Jordan DA, Weiss Michael N, Brent Lauren JN, and Franks Daniel W. 2021. “Common Permutation Methods in Animal Social Network Analysis Do Not Control for Non-Independence.” bioRxiv. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Held Leonhard, and Bové Daniel Sabanés. 2014. Applied Statistical Inference. Berlin, Heidelberg: Springer Berlin Heidelberg. 10.1007/978-3-642-37887-4. [DOI] [Google Scholar]
- James Richard, Croft Darren P., and Krause Jens. 2009. “Potential Banana Skins in Animal Social Network Analysis.” Behavioral Ecology and Sociobiology 63 (7): 989–97. 10.1007/s00265-009-0742-5. [DOI] [Google Scholar]
- Kenny David A, and La Voie Lawrence. 1984. “The Social Relations Model.” In Advances in Experimental Social Psychology, 18:141–82. Elsevier. [Google Scholar]
- Kruschke John K. 2015. Doing Bayesian Data Analysis: A Tutorial with R, JAGS, and Stan. Edition 2. Boston: Academic Press. [Google Scholar]
- Little Roderick JA, and Rubin Donald B. 2002. “Bayes and Multiple Imputation.” Statistical Analysis with Missing Data, 200–220. [Google Scholar]
- Manly Bryan FJ. 1995. “A Note on the Analysis of Species Co-Occurrences.” Ecology 76 (4): 1109–15. [Google Scholar]
- McCulloch Charles E, and Searle Shayle R. 2004. Generalized, Linear, and Mixed Models. John Wiley & Sons. [Google Scholar]
- McElreath Richard. 2020. Statistical Rethinking: A Bayesian Course with Examples in R and Stan. 2nd ed. CRC Texts in Statistical Science. Boca Raton: Taylor; Francis, CRC Press. [Google Scholar]
- Moreno Jacob L, and Jennings Helen H. 1938. “Statistics of Social Configurations.” Sociometry, 342–74. [Google Scholar]
- Morrison Robin E, Eckardt Winnie, Stoinski Tara S, and Brent Lauren JN. 2020. “Comparing Measures of Social Complexity: Larger Mountain Gorilla Groups Do Not Have a Greater Diversity of Relationships.” Proceedings of the Royal Society B 287 (1931): 20201026. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Pearl Judea, Glymour Madelyn, and Jewell Nicholas P. 2016. Causal Inference in Statistics: A Primer. John Wiley & Sons. [Google Scholar]
- Pinter-Wollman Noa, Hobson Elizabeth A, Smith Jennifer E, Edelman Andrew J, Shizuka Daizaburo, De Silva Shermin, Waters James S, et al. 2014. “The Dynamics of Animal Social Networks: Analytical, Conceptual, and Theoretical Advances.” Behavioral Ecology 25 (2): 242–55. [Google Scholar]
- R Core Team. 2020. “R: A Language and Environment for Statistical Computing.”
- Redhead Daniel, McElreath Richard, and Ross Cody T. 2021. “Reliable Network Inference from Unreliable Data: A Tutorial on Latent Network Modeling Using STRAND.” [DOI] [PubMed] [Google Scholar]
- Ross Cody T, McElreath Richard, and Redhead Daniel. 2022. “Modelling Human and Non-Human Animal Network Data in r Using STRAND.” bioRxiv. [DOI] [PubMed] [Google Scholar]
- Rue Håvard, Martino Sara, and Chopin Nicolas. 2009. “Approximate Bayesian Inference for Latent Gaussian Models by Using Integrated Nested Laplace Approximations.” Journal of the Royal Statistical Society: Series B (Statistical Methodology) 71 (2): 319–92. 10.1111/j.1467-9868.2008.00700.x. [DOI] [Google Scholar]
- Rue Håvard, Riebler Andrea, Sørbye Sigrunn H., Illian Janine B., Simpson Daniel P., and Lindgren Finn K.. 2017. “Bayesian Computing with INLA: A Review.” Annual Review of Statistics and Its Application 4 (1): 395–421. 10.1146/annurev-statistics-060116-054045. [DOI] [Google Scholar]
- van de Schoot Rens, Depaoli Sarah, King Ruth, Kramer Bianca, Märtens Kaspar, Tadesse Mahlet G, Vannucci Marina, et al. 2021. “Bayesian Statistics and Modelling.” Nature Reviews Methods Primers 1 (1): 1–26. [Google Scholar]
- Sosa Sebastian, Pasquaretta Cristian, Puga-Gonzalez Ivan, Dobson F Stephen, Viblanc Vincent A, and Hoppitt William. 2021. “Reliable Hypotheses Testing in Animal Social Network Analyses: Global Index, Index of Interactions and Residual Regression.” bioRxiv. [Google Scholar]
- Stan Development Team. 2020. “RStan: The R Interface to Stan.” http://mc-stan.org/.
- Tranmer Mark, Steel David, and Browne William J.. 2014. “Multiple-Membership Multiple-Classification Models for Social Network and Group Dependences.” Journal of the Royal Statistical Society: Series A (Statistics in Society) 177 (2): 439–55. https://doi.org/ 10.1111/rssa.12021. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Wasserman Larry. 2004. All of Statistics: A Concise Course in Statistical Inference. Springer Texts in Statistics. New York, NY: Springer New York. 10.1007/978-0-387-21736-9. [DOI] [Google Scholar]
- Wei William W. S. 2013. “Time Series Analysis.” The Oxford Handbook of Quantitative Methods in Psychology: Vol. 2. 10.1093/oxfordhb/9780199934898.013.0022. [DOI] [Google Scholar]
- Weiss Michael N., Franks Daniel W., Croft Darren P., and Whitehead Hal. 2019. “Measuring the Complexity of Social Associations Using Mixture Models.” Behavioral Ecology and Sociobiology 73 (1): 8. 10.1007/s00265-018-2603-6. [DOI] [Google Scholar]
- Weiss Michael N, Franks Daniel W, Giles Deborah A, Youngstrom Sadie, Wasser Samuel K, Balcomb Kenneth C, Ellifrit David K, et al. 2021. “Age and Sex Influence Social Interactions, but Not Associations, Within a Killer Whale Pod.” Proceedings of the Royal Society B 288 (1953): 20210617. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Whitehead Hal. 2008a. Analyzing Animal Societies. University of Chicago Press. [Google Scholar]
- ———. 2008b. “Precision and Power in the Analysis of Social Structure Using Associations.” Animal Behaviour 75 (3): 1093–99. 10.1016/j.anbehav.2007.08.022. [DOI] [Google Scholar]
- Whitehead Hal, and Dufault Susan. 1999. “Techniques for Analyzing Vertebrate Social Structure Using Identified Individuals.” Adv Stud Behav 28: 33–74. [Google Scholar]
- Whitehead Hal, and James Richard. 2015. “Generalized Affiliation Indices Extract Affiliations from Social Network Data.” Methods in Ecology and Evolution 6 (7): 836–44. 10.1111/2041-210X.12383. [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The BISoN example code is indexed at https://doi.org/10.5281/zenodo.6603327. The bisonR package is indexed at https://doi.org/10.5281/zenodo.7611719.
