DOI: 10.5061/dryad.rfj6q57j2
title: Hierarchically embedded scales of movement shape the social networks of vampire bats

description: Social structure can emerge from hierarchically embedded scales of
 movement, where movement at one scale is constrained within a larger scale
 (e.g., among branches, trees, forests). In most studies of animal social
 networks, some scales of movement are unobserved, and the relative
 importance of the observed scales of movement is unclear. Here, we asked:
 how does individual variation in movement, at multiple nested spatial
 scales, influence each individual’s social connectedness? Using existing
 data from common vampire bats (Desmodus rotundus), we created an
 agent-based model of how three nested scales of movement—among roosts,
 clusters, and grooming partners—each influence a bat’s grooming network
 centrality. In each of 10 simulations, virtual bats lacking social and
 spatial preferences moved at each scale at empirically-derived rates that
 were either fixed or individually variable and either independent or
 correlated across scales. We found the number of partners groomed per bat
 was driven more by within-roost movements than by roost switching,
 highlighting that co-roosting networks do not fully capture bat social
 structure. Simulations revealed how individual variation in movement at
 nested spatial scales can cause false discovery and misidentification of
 preferred social relationships. Our model provides several insights into
 how nonsocial factors shape social networks.
description: <strong><em>Empirical
 analyses</em></strong> We analyzed
 existing<em> </em>published data to estimate how often common
 vampire bats switched roosts, clusters, and partners. To estimate
 individual rates of roost-switching, we used 1,336 observations of 81
 free-ranging bats of both sexes (38 males and 43 females) that were
 observed &gt;25 times across 11 tree roosts along the Rio Corobici in
 Guanacaste, Costa Rica (1, 2). We also made grooming networks using 1,761
 grooming interactions among 29 of these bats (3). To estimate individual
 rates of cluster switching and partner switching, we used 4,092
 observations of clusters (defined as bats roosting in the same corner of a
 flight cage) and 22,836 observations of grooming from 31 vampire bats of
 both sexes (5 males and 26 females) at a captive colony in Panama (4).
 Individuals in both studies were identified visually using unique
 combinations of distinctive wing bands. To estimate
 roost-switching rates, we only used observations of the same bat or roost
 on consecutive days, because roost switching would be underestimated when
 a bat moved away and then returned to the same roost between observations
 (see supplement in associated paper for details). To calculate
 cluster-switching and partner-switching rates, we counted consecutive
 observations of the same bat where a switch occurred, then divided that
 count by the total time elapsed between those observations (see supplement
 for details). We only considered consecutive cluster-switching and
 partner-switching observations that occurred within a sampled hour. To
 calculate <em>within-cluster </em>partner-switching rates, we
 did not count partner switches and the associated time lapse that occurred
 due to partner switches between clusters. To create
 co-roosting and co-clustering networks, we defined edge weights in the
 co-roosting and co-clustering networks as the ‘simple ratio index’ of
 association (5–7). To create grooming networks, we defined edge weights as
 total minutes of grooming. To assess within-bat correlations between
 movement types, we used a linear model to test if cluster-switching rates
 predicted within-cluster partner-switching rates. To
 determine how well roost, cluster, and partner-switching rates predict the
 overdispersed counts of the number of bats groomed (outdegree centrality),
 we fit a quasi-Poisson generalized linear mixed-effects model with each of
 the three rates as single predictors, and bat as random intercept. We used
 nonparametric bootstrapping to create a 95% confidence interval (CI)
 around the standardized coefficient (b).
 <strong><em>Agent-based
 model</em></strong> We created a model
 using NetLogo 6.2.0 and used it to simulate movements of virtual vampire
 bats that lacked preferences for roosts, clusters, or partners. Each of 11
 roosts contained 4 locations for potential clusters. We randomly assigned
 each virtual bat to a starting roost and cluster location. For each
 spatial scale, each bat had a switching propensity randomly sampled with
 replacement from empirical estimates of the probabilities of movement.
 Switching probabilities at every scale were conditional on the time since
 the last switch (see supplement). We initially ran all
 the simulations with populations of 200 virtual bats, the approximate
 number of bats encountered and banded by Wilkinson along the Rio Corobici
 between 1978 and 1983 (1, 2). To explore how our results would change with
 fewer bats and limited partner choice, we later ran the simulation with
 100 virtual bats to explore how our results would change with fewer bats,
 leading to smaller group sizes and limited partner choice (2.3 bats per
 cluster, or an average of 1.3 partners per cluster). To
 isolate the effects of movement, we fixed the probability of grooming per
 minute for all virtual bats at 1.8% (the mean probability that a captive
 vampire bat groomed another bat during the sampled hours from empirical
 observations of captive vampire bats (4)). We included a synchronous
 200-minute foraging period where bats left all roosts to forage outside
 the roosts. The simulations recorded observations of behaviors every
 minute for 15 days.  When in a roost, virtual bats
 randomly decided every minute whether to groom a partner and whether they
 would switch partners based on an increasing probability related to the
 time since last switch at that scale. The decision was solely determined
 by the groomer initiating the exchange; the receiver did not decide
 whether to accept grooming. Each bat could only groom one partner at any
 particular minute, but multiple bats could groom the same bat during that
 minute. Virtual bats decided whether to switch clusters within their roost
 once every hour. Additionally, they decided whether to switch roosts once
 per day after returning from foraging. If a bat changed
 its partner as a result of cluster or roost switching, we did not count
 this event as partner switching. Similarly, if a bat changed clusters due
 to roost switching, we did not count this event as cluster switching. We
 took this approach to test the effects of a bat’s decisions at each scale
 rather than the effect of what it experiences. Although we measured
 within-roost cluster switching and within-cluster partner switching, for
 brevity, these are simply referred to as ‘cluster switching’ and ‘partner
 switching.’ <strong><em>Simulations using
 agent-based model</em></strong> We ran five
 types of simulation, each 100 times, and we ran those five simulation
 types across two different population sizes, once for 100 bats and again
 for 200 bats. Each of the five simulation types had switching propensities
 that were either fixed or individually-variable and either correlated or
 uncorrelated. In simulation 1, virtual bats were assigned a random
 propensity of roost, cluster, and partner switching; these propensities
 were uncorrelated within each individual bat because they were drawn
 independently from empirical distributions. The resulting standardized
 coefficients of the switching rates from this simulation measured how well
 each movement type predicted grooming outdegree when controlling for the
 other movement types. In simulations 2-4, one type of
 movement varied among bats while the two others were fixed (to the mean
 observed from the empirical data). In simulation 2, only partner-switching
 propensity varied across individuals. In simulation 3, only
 cluster-switching propensity varied across individuals. In simulation 4,
 only roost-switching propensity varied across individuals.
 Using simulations 2-4, we estimated the
 <strong><em>reference effects</em>,</strong>
 defined as the median standardized coefficients of the switching rate when
 switching propensity was <em>not </em>variable between bats.
 The <em>reference effects </em>measure how well one movement
 type predicts grooming outdegree when it lacks individual variation in
 switching propensity. We estimated the <strong><em>isolated
 effects</em></strong><em> </em>of individual
 variation in each switching propensity, defined as the difference between
 the standardized coefficient of the switching rate when only it was
 variable between bats and the reference effect. The <em>isolated
 effect </em>measures how well individual variation in only one
 movement propensity predicts grooming outdegree while accounting for the
 reference effect. Simulation 5 was similar to
 simulation 1 except that the three switching propensities were positively
 correlated, such that virtual bats that moved most frequently at one scale
 also moved most frequently at other scales (see supplement). By comparing
 the results of simulations 1 and 5, we could therefore assess the effect
 of switching propensities being correlated (simulation 5) or uncorrelated
 (simulation 1). In sum, our model allowed us to ‘switch
 on and off’ the existence of realistic individual variation in movement at
 each spatial scale to isolate the social consequences for the individuals,
 while eliminating the confounding effects of social and spatial
 preferences found in real vampire bats. By adding or removing individual
 variation in movement at each scale or across all scales, and by making
 these movements correlated or not across scales, these simulations allowed
 us to isolate the causal effects of individually variable movement on
 grooming network centrality. Note that a bat’s assigned
 probability of switching (its switching <em>propensity</em>)
 is not the same as the number of times it actually switched during the
 simulation (its switching <em>rate</em>). When switching
 propensity was fixed, all bats with the same time since last switch also
 had the same probability of switching at that time step. However, as the
 model was randomized, the realized number of switching events differed,
 even when bats had the same switching propensity. This can be seen in Eq.
 1 and Eq. 2, where <em>o</em> is the odds of a switch at that
 time step, <em>p</em> is the probability of a switch,
 <em>a</em> is the intercept of a logistic mixed effects model
 (which could be set to be variable or equal for all bats),
 <em>b</em> is the slope of the logistic mixed effects model
 (which was always the same across bats), and <em>t</em> is the
 number of time steps since last switch. When a particular switching
 propensity was fixed, <em>a</em> was the same for all bats
 (and, consequently, <em>p</em> if <em>t</em> was
 also the same). However, every time step, the virtual bats generated an
 independent value, <em>r</em>, which, if less than
 <em>p</em>, signaled the bat should try to switch partners.
 Because each bat generated a different <em>r </em>every time
 step, the realized partner switching rate was different by bat.
 (1)  ln(o) = a + bt (2)  p = o / (1 +
 o) The goal of these simulations was to manipulate the
 switching <em>propensity</em> (which cannot be measured from
 the empirical data) and then assess the relative effect of the resulting
 individual differences in observed switching <em>rate</em>.
 For a more detailed description of the agent-based model, see the
 Overview, Design Concepts, Details (ODD) in the supplement.
 <strong><em>Analysis of simulated
 data</em></strong> Over the course of 15
 simulated days, we counted cases of roost, cluster, and partner switching.
 We used grooming rates to create the grooming network. We measured two
 measures of grooming network centrality:
 <em>out</em><em>degree</em>, the number of
 grooming recipients groomed by the focal bat, and
 <em>pagerank</em>, which estimates connectedness using both
 direct ties (grooming receivers) and indirect ties (grooming receivers of
 those receivers). To estimate pagerank based on grooming given rather than
 grooming received, we calculated it from the transposed grooming matrix.
 To assess how each movement type predicted grooming network centrality, we
 fit a Poisson generalized linear model with outdegree (count of partners
 groomed) as the response, and the scaled counts of roost, cluster, and
 partner-switching events as predictors. We did not detect evidence for
 over-dispersion. Effects on outdegree and pagerank centrality were almost
 identical (see supplement for results).
 <strong><em>Effect of individual variation in
 movement and habitat structure on tests for preferred
 relationships</em></strong> Individually
 variable movements and hierarchically embedded habitat structures create
 highly nonrandom association rates that could be taken as false evidence
 of social differentiation (preferred social relationships) if these
 features are not properly controlled for in the analysis (8). Type 1 error
 means that social preferences might be falsely detected, exaggerated, or
 inaccurate when inferences ignore the role of habitat structure and
 individual variation in movement. To explore this, we used permutation
 tests to test the significance of social differentiation, the coefficient
 of variation of edge weights, which is a standard method to test for
 social preference (5, 9). We did 50 permutation tests for detecting social
 differentiation using 5 randomly selected grooming networks for each of
 the 10 simulations. To calculate the p-value, permutation tests were
 repeated 100 times, each with 10,000 permutations. To
 illustrate the importance of constraining permutations to account for
 habitat structure, we first used <em>unconstrained permutation
 tests</em>, which permuted the partners across all observed events
 from randomly selected simulations. Next, to investigate the effects of
 spatial and temporal constraints on permutations, we used two types of
 constrained permutation tests on the same simulation. In the
 <em>semi-constrained permutation test</em>, we created the
 null model by only permuting groomed partners observed in the same day and
 roost. In the <em>highly</em> <em>constrained
 permutation test</em>, we created the null model by only permuting
 partners observed in the same hour and cluster. Because virtual bats had
 no social preferences, any inferences of preferred relationships
 constituted type 1 error. We ran each of the demonstrative permutation
 tests 100 times, each with 100,000 permutations to the partner
 groomed. Next, we tested which factors contributed to
 false appearance of preferred relationships. To do this, we used
 unconstrained permutation tests to check for social differentiation in
 data generated by four additional ‘control simulations’, each with less
 complexity. The first control simulation lacked hierarchically embedded
 scales of movement, because all virtual bats were in a single cluster. The
 second control simulation lacked both hierarchically embedded scales of
 movement and individual differences in partner-switching propensity.
 Although partner-switching propensity was constant across all bats, each
 bat still had a greater probability of grooming the same partner in series
 rather than grooming a new partner, which we call “byproduct partner
 fidelity”. The third control simulation was the same as the second but it
 removed byproduct partner fidelity: instead of a bat deciding whether or
 not to switch  partners, it selected a random available partner. Finally,
 the fourth control simulation was identical to the third except all bats
 groomed simultaneously. We used these control simulations to establish
 which created the false appearance of social differentiation. Again, we
 ran these latter demonstrative permutation tests 100 times, each with
 100,000 permutations.
 <strong><em>References</em></strong> Wilkinson GS. The Social Organization of the Common Vampire Bat: I. Pattern and Cause of Association. Behav Ecol Sociobiol. 1985;17(2):111–21. Wilkinson GS. Reciprocal food sharing in the vampire bat. Nature. 1984 Mar;308(5955):181–4. Wilkinson GS. Social grooming in the common vampire bat, Desmodus rotundus. Anim Behav. 1986 Dec 1;34(6):1880–9. Razik I, Brown BKG, Page RA, Carter GG. Non-kin adoption in the common vampire bat. R Soc Open Sci. 2021 Feb;8(2):rsos.201927, 201927. Farine DR, Whitehead H. Constructing, conducting and interpreting animal social network analysis. J Anim Ecol. 2015;84(5):1144–63. Whitehead H, Dufault S. Advances in the Study of Behavior. 1999 Feb 26;28:33–74. Hoppitt WJE, Farine DR. Association indices for quantifying social relationships: how to deal with missing observations of individuals or groups. Anim Behav. 2018 Feb 1;136:227–38. Farine DR, Carter GG. Permutation tests for hypothesis testing with animal social network data: Problems and potential solutions. Methods Ecol Evol. 2022;13(1):144–56. Whitehead H. Analyzing Animal Societies: Quantitative Methods for Vertebrate Social Analysis. University of Chicago Press; 2008.
description: # Hierarchically embedded scales of movement shape the social networks of
 vampire bats
 [https://doi.org/10.5061/dryad.rfj6q57j2](https://doi.org/10.5061/dryad.rfj6q57j2) This project analyzed the relation between social connectedness and hierarchically embedded scales of movement using both real and simulated data of the common vampire bat. Included are the raw empirical data, simulated data, NetLogo models, and R code used to analyze the data and create graphs. This is a repository of all data files and scripts used to study how movement at multiple, hierarchically embedded scales of movement affects the centrality of vampire bats. For a full description, please see the associated paper. ## Description of the data and file structure All necessary R packages and NetLogo extensions are listed at the top of each R and NetLogo file, respectively. Filepaths will need to be edited to properly run code. The file "`roosting_information.csv`" contains observations of roost-level associations of wild common vampire bats recorded in a previous study (see "Reciprocal Food Sharing in the Vampire Bat" and "The Social Organization of the Common Vampire Bat: I. Pattern and Cause of Association," both by Gerald S. Wilkinson), noting the time, place, and identity of bats in particular tree roosts on each observation. The file "`roost_switching.R`" modifies the original dataset to check whether a change in roost occurred on each observation while monitoring the time since last roost switch for each bat. This is outputted as the "`roost_switching.csv`" file. The first column of "`roosting_information.csv`," called "Date," contains the date of observations of each tree in the format "MM/DD/YYYY." Each row represents a different observation of bats' locations. The second column, "Roost," contains the roost identification code, with each tree roost having a unique code. The third column, "Group," provides a numeric value to each identification code for the roosts (e.g., Roost RBO is Group 10). "Age" denotes whether each bat in each observation is a juvenile at the time of observation ("J") or an adult ("A"). Similarly, "Sex" denotes whether each bat is male ("M") or female ("F"). "Band" provides a unique identification number for each bat, and "ID" shows both the gender and band number (e.g., a female bat with a band code of 512 will have an ID of F512). There are several blank entries for "Band" and "ID," which represent observations of a roost where no individuals were observed inside of it. In these situations, the identification of "Age" and "Sex" are used as placeholders. The first column of "`roost_switching.csv,`" called "Date," contains the date of observation of each tree roost, measured as the number of days since January 1, 1970. "Roost," "Group," "Age," "Sex," "Band," and "ID" are all the same as in "roosting_information.csv." Rows all still represent unique observations of individual bats. The first new column, "switch_w" denotes the number of switches that we know occurred since the last time that bat was observed. "potential" states the number of potential switches that could have occurred since the last observation of the bat. "n.days" is the number of days since the last observed switch for that particular bat. The file "`clustering_information.Rdata`" (or csv) shows the positions of captive common vampire bats in different corners of a flight cage in a captive, recorded at regular intervals (see "Non-Kin Adoption in the Common Vampire Bat," by Imran Razik, Bridget K. G. Brown, Rachel A. Page, and Gerald G. Carter). The "`cluster_switching.R`" code modifies the original dataset to denote the position of each bat at each recording period, marking whether a cluster switch occurred and the time since last switch for each bat. This is outputted as "cluster_switching.csv." The first column of "`clustering_information.csv`" is the observation number, which simply assigns a unique marker for each observation from each cluster observed. As such, each row represents a different camera observation of a different cluster of touching bats. The second column, "cage," shows whether the bats were observed in the "big_cage" (a 2.1 × 1.7 × 2.3 m flight cage) or the "small_cage" (28 × 28 × 40 cm clear, acrylic observation cage). "phase" shows whether the bats were observed pre-forced proximity ("1"), during forced proximity within triads of individuals ("2"), or post-forced proximity ("3"). "hour" represents the hour of observation (e.g., 130 represents 1:30 AM in Panama at the time of observation). "period" is the date of observation in "YYYY.MM.DD" format. "camera" shows which of several, uniquely identified cameras observed the observaiton. "period.cam" combines thr prior three columns of information into one in the format of "YYYY.MM.DD_HHmm_C," where Y is year, M is month, D is day, H is hour, m is minute, and C is camera (e.g., a bat observed June 23, 2019 at 1 AM on camera 1 would be logged as 2019.06.23_0100_1). "cluster" assigns an ID number to each cluster of touching bats, which is unique to all clusters observed by that camera at that time. If the cluster is assigned a value of "0," then there were no clusters observed on that camera at thaat time. "A" through "V" bats occupying that cluster, with each entry besides "N/A" representing a different bat. For example, if A through Z were populated in a particular row by "bxdlx" in "A," "cwd" in "B," and "cnone" in "C," but "N/A" in every other column, that mean bxdlx, cwd, and cnone were observed clustering together. In "`cluster_switching.csv`," each row represents a different observation of a vampire bat. "time" shows the time of the observation, as measured in second from the beginning of January 1, 1970. "bat" shows the unqiue identifiers for each bat. "camera" shows what camera they were seen on, with a 0 representing that the bat wasn't seen at that time. "switch" denotes whether the bat moved between groups (cameras, which obseved distinct sections of the cage) since the last observation ("1" is yes). "latency" measures the number of half hours since last switching groups. Finally, the "`events.Rdata`" (and .csv) file shows a log of the grooming events for captive vampire bats (recorded for "Non-Kin Adoption in the Common Vampire Bat," by Imran Razik, Bridget K. G. Brown, Rachel A. Page, and Gerald G. Carter). The "`partner_switching.R`" code can then be run marks whether a bat switched partners on each grooming event, and measures time since last partner switch for each bat. This data is outputted as "`partner_switching.csv`." In "`events.csv`," each row represnts a different observation of interaction between vampire bats observed in captivity. The first column provides a unique identifier for each interaction. The second column, "obs" is a summary of the observation observed, stating the date in "YYYY.MM.DD_HHmm" format, along with the actor, receiver, and type of behavior. For example, if bat add groomed bat cnone on June 23, 2019, this entry would state "2019.06.23_0300 add_cnone g." "date" provides the date of the observation in "MM/DD/YYYY" format, and "hour" describes the time of observation in "HHmm" format (e.g., 1 am is "100"). "period combines the "date" and "hour" into one in "YYYY.MM.DD_HHmm" format. The "cage" describes which cage the bats were observed in, as described for "clustering_information.csv" above. "video," shows the name of the video file the interaction was observed on. "camera" show which camera the interaction was observed on. "scorer" denotes the name of the individual who observed the interaction. "is.fasting.trial" states whether bats were being fasted (denied food to encourage food sharing) at that time. "fasted.bats" lists all bats that were fasted at that time, or "none" if not a fasting trial. "actor" shows who is performing an action, such as grooming or food sharing, with each entry showing the bat's ID. "receiver" is the recipient of the actor's action. "behav" notes whether the bats were fighting ("x"), grooming ("g"), or food sharing ("f"). "h.start" provides the hour that interaction began, "min.start" the minute, and "sec.start" the second. Similarly, "h.end," "min.end," "sec.end" marks with the ineraction ended. "duration" notes the time, in seconds, that the interaction took. "notes" marks any abnormalities or other points of interest not captured in the rest of the data for that observation. "`partner_switching.csv`" has the same columns as "`events.csv`," but with two additional columns. "switch" denotes whether bats switched grooming partners since last switch ("1" is yes), and "latency" measures the number of minutes since last switch. The "`roost_switching.csv`," "`cluster_switching.csv`," and "`partner_switching.csv`" files are required to run the "`get_switch_prob-03.R`," which creates three datasets that show the probability of switching at a particular scale based on time since last switch at that scale. In these datasets, rows represent different individual vampire bats from empirical data sets, and each column represents a different time since last switch (days for roost switching, hour for cluster switching, minute for partner switching). These files are outputted as "`roost_switching_probs.csv,`" "`cluster_switching_probs.csv`," and "`partner_switching_probs.csv`." The first column of "`roost_switching_probs.csv`," "`cluster_switching_probs.csv,`" and "`partner_switching_probs.csv`" show a list of all bats in their respective datasets, making each row represent a different bat. Each subsequent column represented a different successive time frame since last switch, populated by the probability of that bat switching at that scale. For example, "min5" in "`partner_switching_probs.csv`" represents 5 minutes since last switch, and the value for bat bs in that minute is 0.76. That means that 5 minutes after switching to another grooming partner, "bs" will have a 76% chance of grooming a new partners. The same rules apply for "`roost_switching_probs.csv`" and "`cluster_switching_probs.csv`," but each column represents a different day and hour, respectively. The data from "`roost_switching_probs.csv`," "`cluster_switching_probs.csv`," and "`partner_switching_probs.csv`" have all been manually inputted into the relevant NetLogo models that require them as an input. The models, "`roost-correlated.nlogo`" and "`roost-uncorrelated.nlogo`," run an agent-based model where individual vampire bats move at empirically-derived roost-switching, cluster-switching, and partner-switching rates, while the number of switches at each scale and the number of grooming partners is monitored by bat. These models differ only in that switching rates are correlated is "roost-correlateed.nlogo," and not correlated in "`roost-uncorrelated.nlogo`" (see Supplement of research paper for details). The number of bats (100 or 200) needs to be manually manipulated by entering the code and changing the value of "Bats." Additionally, whether switching probabilities are variable by bat can be edited in the "`roost-uncorrelated.R`" code by commenting out "set roost-switch-vector matrix:get-row roost-switch-matrix b" and leaving in "set roost-switch-vector matrix:get-row rs-mean-matrix 0" (or cluster, partner) in the setup section to make that switching type non-variable (or vice versa, to make that switcing probability variable). This code generates association data, showing where vampire bats reside each minute, and interaction data, showing a list of all grooming interactions each bat had during the course of the simulation. 1,000 association and interaction files have been uploaded "`associations.zip`," and "`interactions.zip`." Interaction and association files labeled 0 - 99 are from simulations with uncorrelated movement rates, 200 bats, and inidividually variable movement rates at all scales. Interaction and association files labeled 100 - 199 are from simulations with uncorrelated movement rates, 200 bats, and inidividually variable roost-switching rates. Interaction and association files labeled 200 - 299 are from simulations with uncorrelated movement rates, 200 bats, and inidividually variable cluster-switching rates. Interaction and association files labeled 300 - 399 are from simulations with uncorrelated movement rates, 200 bats, and inidividually variable partner-switching rates. Interaction and association files labeled 400 - 499 are from simulations with correlated movement rates, 200 bats, and inidividually variable roost-switching rates. Interaction and association files labeled 500 - 599 are from simulations with uncorrelated movement rates, 100 bats, and inidividually variable movement rates at all scales. Interaction and association files labeled 600 - 699 are from simulations with uncorrelated movement rates, 100 bats, and inidividually variable roost-switching rates. Interaction and association files labeled 700 - 799 are from simulations with uncorrelated movement rates, 100 bats, and inidividually variable cluster-switching rates. Interaction and association files labeled 800 - 899 are from simulations with uncorrelated movement rates, 100 bats, and inidividually variable partner-switching rates. Interaction and association files labeled 900 - 999 are from simulations with correlated movement rates, 100 bats, and inidividually variable roost-switching rates Any associations files first column shows the unique, numeric identifier for the bats in simulation. All subsequent column show the position of the bats at increasing times from start. For example, if bat "157" is shown in "32" on the 172nd column, that means 171 simulated minutes since the beginning of the simulation, bat 157 was found on cluster 32. Interaction files first column similarly shows the unique identifiers for the bats. The second column is a count of the number of roost switches that bat made during the course of the simulation. Similarly, the third column shows cluster switches, and the fourth, partner switches. Subsequent columns represent a list of grooming events in chronological order, listed by the receiver of the grooming event. For example, if in the 10th column of the "12" row we see "(turtle 91)," that means that the 6th bat that bat 12 groomed was bat 91. Note that because each bat groomed different amounts, row lengths differ within interaction files. The model "`roost-no-scales.nlogo`" removes scales of movement,puts all bats in the same cluster, only allowing partner switching. The model "`roost-nothing.nlogo`" additionally gets rid of partner switching propensities, allowing bats to groom without byproduct partner fidelity. The former was used to generate "`interactions2400.csv`" and "`interactions2401.csv`." The latter was used to generate "`interactions2402.csv`" and "`interactions2403.csv`." "`interactions2400.csv`" and "`interactions2401.csv`" are setup similarly to other interactions files, however, they do not record roost or cluster switching. As such, the first column shows bat IDs, the second shows a count of partner swithching events, and the sucsequent ones show a list of bats groomed chronologically. "`interactions2402.csv`" and "`interactions2403.csv`" additionally remove the partner switching count column. Two more NetLogo models were made, "`roost-uncorrelated2.nlogo`" and "`roost-uncorrelated3.nlogo`," which output a file showing the cluster and hour of each interaction or the roost and day of each interaction, respectively. The latter was used to generate "interactions2600.csv," which is orgnaized identically to "`interactions0.csv`" through "`interactions999.csv`." It also generated "`interactions2600-roost.csv`" and "`interactions2600-time.csv`" which has the same first four columns as "`interactions2600.csv`," but records the cluster id and time (measured in days) of each interaction in subsequent columns, rather than grooming partner. The file, "`social_diff.R`," uses both the empirical datasets mentioned aboved and the simulated interaction files to produce estimates of observed and expected social differentiation. Specifically, this file tests whether their is significant social differentiation in the empirical data, tests 50 random simulated datasets to test for significant social differentation, and also measures observed and expected differentations for "`interactions548.csv`" (a normal, randomly selected simulation), "`interactions2400.csv`" (no movement outside partner switching), "`interactions2401.csv`" (no variation in partner switching propensity), "`interactions2402.csv`" (no byproduct partner fidelity), and "`interactions2403.csv`" (simultaneous grooming). The observed social differentiations of these five latter simulations is outputted as "`obs.csv`," and the expected values as "`exp548.csv`," "`exp2400.csv`," "`exp2401.csv`," "`exp2402.csv`," and "`exp2403.csv`." A histogram of social differentiation in these five simulations is made in "`FIGURE_S6.R`," using the observed and expected social differentiations as an input. Further, "`social_diff.R`" also measures the observed ("`obs2.csv`") and expected permutations of "`interactions2600.csv`," with unconstrained permutations ("`exp2600a.csv`"), permutations constrained within day and roost ("`exp2600b.csv`"), and permutations constrained within cluster and hour ("`exp2600c.csv`"). These files are used to create histograms of social differentiations via "`FIGURE_S7.R`." Exp files' first column shows an identifier number for permutation tests. The second column, "exp," shows the expected social differentiation from the permutation tests. Obs files' first column shows the a unique idenfier for each simulation ran, and "obs" shows the observed social differentation from that simulation "`social_diff.R`," also generated the data used to populate "`soc_diff.xlsx`," which shows the social differentiation (expected and observed) after selecting random simulations and performing permutation tests on them. "run" is the ID of the simulation run. "sd" is the observed social differentiaiton. "p" is the p-value, for testing significance. "mean exp" was the mean expected social differentiation after running permuation tests. "bats" denotes the number of bats in the simulation. "`social_diff.R`," also generated the data used to populate "`roost_soc_diff.csv`," which displays a unique identifier for each bat in the first column, observed social differentiation under "soc_diff," and the number of times the bat was seen under "Observations[Observations &gt; 25]." "`cluster_soc_diff.csv`" and "`partner_soc_diff.csv`" are also made, holding a similar structure, except it lists the count of bats under "Observations[Observations &gt; 100]" and "Observations," respectively. Interactions files 0 - 999 are analyzed in via "`scales_of_movement02.R`," which analyzes a subsection of the interaction data files, and outputs the effects of switching rate (standardized coefficients of switching rate) on degree and pagerank. To use this code, the name of the output file and input files must be specified. We used the convention of analyzing by groups of 100 (see above). The file, "`degree_est0.csv`" was the output of analyzing "`interactions0.csv`" through "`interactions99.csv`," and "`degree_est1.csv`" was the output of analyzing `"interaction100.csv`" through "`interactions199.csv`" and so on. The files "`degree_est0.csv`" through "`degree_est9.csv`" are summarized by violin-box-and-whisker plots, visualizing the effect of movement rates on degree using "`FIGURES_4_5_S2_S3`." Similarly, "pagerank_est0.csv" through "`pagerank_est9.csv`" are visualized via violin-box-and-whisker plots via "`FIGURES_S4_S5`." The degree_est and pagerank_est files first column shows a simulation number. "scale.rs.," "scale.cs.," and "scale.ps." show the measured standardized effect of roost switching, cluster switching, and partner switching on outdegree centrality and reverse pagerank, respectively. The file "`consecutive.R`" takes the original empirical datasets and finds the mean switching rate for every bat (outputted as "`roost_sw.csv`," "`cluster_sw.csv`," "`partner_sw.csv`," and "`partners_sw2.csv`," which is within-cluster partner switching). "`FIGURE_2.R`" plots this data as a histogram. The first column of "`roost_sw.csv`" and its counterparts can be used as an identifier. The column, "roost_sw" shows the average roost switching rate, measured in switches per day. "cluster_sw" is measured in cluster switches per day, "partner_sw" is measured in partner switches per hour, and "partner_sw2" represents within-cluster partner switching in an hour. "Bats_w" in "`roost_sw.csv`" or "bats_i" in the other files show the bat IDs associated with each switching rate. Then, "`centrality.R`" uses the datafiles generated by "`consecutive.R`," as well as "`partner_switching.csv`" and "`transcribe.csv`" ("Social grooming in the common vampire bat, *Desmodus rotundus*" by Gerald S. Wilkinson), to output data files ("gd.csv" for cluster and partner switching, "`centrality.csv`" for roost switching), which contain the outdegree centrality and switching rate for all bats we have data on both. "FIGURE_3.R" creates three linear model plots showing the relationship between degree centrality and movement rate at each scale. "`transcribe.csv`" shows counts of pairwise grooming interactions observed by Wilkinson in his field studies. "donor" shows the identifier of bats who groomed other bats, and "receiver" shows the IDs of bats who received grooming. "one-way" is a count of times where the donor was observed grooming the receiver, while "two-way" is a count of grooming that occurred simultaneously from donor to receiver and from receiver to donor. "crossed out" and "underlined notes" were notes taken during the handwritten transcription process, with "1" representing yes. "`gd.csv`" shows a list of bats in the captive, empirical data, where the first column is just a list of unique numbers. "bat" shows the unique ID of each bat, and "n" represents the number of bats groomed. "cs," "ps," and "ps2" represent cluster switching rate (per day), partner switching rate (per hour), and within-cluster partner switching rate (per hour). "centrality.csv" has a first column showing a unique number per entry, and "bats" shows the name of the bat in the study. "centrality" shows outdegree centrality, and "roost_switch" shows the roost switching rate (per day). "`FIGURE_S1.R`" requires "`gd.csv`" to create a linear model plot showing the relationship between within-cluster partner switching and cluster switching. ## Sharing/Access information Data and programs can also be accessed from the following sources: * [https://github.com/anonymousscientist8/scales-of-movement](https://github.com/anonymousscientist8/scales-of-movement) Data was derived from previous research by authors from the following sources: * Wilkinson GS. Social grooming in the common vampire bat, *Desmodus rotundus*. Anim Behav. 1986 Dec 1;34(6):1880–9. * Wilkinson GS. The Social Organization of the Common Vampire Bat: I. Pattern and Cause of Association. Behav Ecol Sociobiol. 1985;17(2):111–21. * Wilkinson GS. Reciprocal food sharing in the vampire bat. Nature. 1984 Mar;308(5955):181–4. * Razik I, Brown BKG, Page RA, Carter GG. Non-kin adoption in the common vampire bat. R Soc Open Sci. 2021 Feb;8(2):rsos.201927, 201927. * Razik I, Brown BKG, Carter GG. Forced proximity promotes the formation of enduring cooperative relationships in vampire bats. Biol Lett. 2022;18;20220056.