The methods are built on the broader literature on cooperation in dynamic networks5,8,61,62,63,64,65,66. A total of 1073 participants from the United States were recruited from Prolific (prolific.co) during the spring and summer of 2022, and embedded in 40 dynamic networks (average initial network size = 26.8). Participants self-selected for the study by following a link from Prolific to a custom application for data collection. Specifically, following closely related work8,65, we used a version of Breadboard67 that was tailored to our experiment. All procedures were approved by the Institutional Review Board at the University of South Carolina.
Because Democrats are overrepresented on platforms like Prolific68,69, we needed to ensure that our networks were not populated solely with Democrats. While Prolific does not allow screening on political parties, it does allow screening on whether participants identify themselves as liberal or conservative. In the past, self-identified liberals and conservatives were distributed relatively equally between the Democratic and Republican parties. But contemporary liberals and conservatives are very likely to identify as Democrat and Republican, respectively19. Thus, for each experimental session, we created two Prolific studies: one for liberals and one for conservatives and moderates. (No mention was made of politics in the links to the studies.) Both Prolific studies provided the same description of the experiment and provided the same study link. In the liberal version of the study, we allowed a maximum of 15 people to follow the link from Prolific to our experiment. In the conservative and moderate version of the study, we allowed 25 people to follow the link. The study needed at least 20 participants for the interaction phase to begin. Thus, allowing a maximum of 15 liberals (as self-identified in their Prolific profiles) to enter the session guaranteed we would never have a session with Democrats only.
Participants first completed an informed consent form. Thereafter, participants in the three experimental conditions indicated their political orientation on a six-point scale, with 1 being “much closer to the Republican Party” and 6 being “much closer to the Democratic Party.” We classified participants as Republican if they responded 1–3 and Democrat if they responded 4–6. We employed a six-point scale to avoid having many participants classify themselves as Independents. It is possible that forcing participants who consider themselves more independent to classify themselves as either a Democrat or Republican crates a more conservative test of the arguments outlined above. In the three conditions where political identities were visible, each participant’s network node was color-coded to match their political orientation, red for Republicans and blue for Democrats. Those in the control condition were asked about their political orientation in the post-study questionnaire. Thus, control participants’ nodes did not denote their political orientation.
Each participant then read detailed instructions on decision-making and how network dynamics would occur70. Following the experimental instructions, participants were asked five questions to assess comprehension. Participants needed to correctly answer at least four of these questions to move on to the actual experiment. At least 20 participants who successfully passed the comprehension check were required for the session to proceed. Between 20 and 28 participants were admitted into the study in each session. If fewer than 20 participants passed the comprehension check, the session was canceled. The Supplementary Methods section of the SI includes screenshots from the experimental instructions, comprehension check questions, and the actual experiment.
Prior work shows that initial network topology shapes cooperation patterns71. Thus, following closely related work4,8,37,45,56,65,66, initial networks were random (Erdös–Rényi) graphs with a density of 0.167, or about 4.5 ties per node on average. During the cooperation phases, participants only saw the alters to whom they were connected, rather than the entire network of 20–28 nodes.
Each participant started the study with 1000 monetary units (1000 monetary units = $1). Participants’ total monetary units and their alters’ total monetary units were visible throughout the study. Previous work on cooperation in networks differs in whether participants make a binary decision to cooperate or defect4,5,9, or whether cooperation is measured continuously, allowing degrees of cooperation or non-cooperation45,66,72. Because continuous measures allow more statistical power73 and because cooperation in the real world is often a matter of degree, we measured cooperation on a continuous scale. Prior work also differs in whether each participant makes a single decision that affects all alters4,5, or makes separate decisions for each alter8,9. Given our focus on differences in the treatment of ingroup vs. outgroup members, our participants made separate decisions about the number of monetary units to give to each of their alters. That is, participants did not have to send the same number of monetary units to each alter. After making independent decisions about how much to cooperate with each of their partners, each participant was told how much they received from each of their partners that round. The monetary units sent were deducted from the participant’s total number of monetary units, and any monetary units received from alters (i.e., after being doubled) were added to the participant’s total number of monetary units.
Participants had the option to sever one tie and propose a new one every four rounds. Prior work shows that when there are too many or too few opportunities to alter ties, it limits the ability of cooperators to isolate themselves from defectors. Allowing participants to sever one tie every three rounds is sufficient to alleviate this concern5,66. Closely related studies tend to follow this design37,45. Our experiment followed these procedures but had tie updates every fourth round, rather than every third, to prevent the experiment from ending on a tie update round with no option to make decisions vis-à-vis new partners immediately after the tie update.
During the tie update phases, participants first decided whether to sever one of their ties. If a participant chose not to sever a tie, they were not given an opportunity to request a tie with another player during that tie update phase8,37,45. If a participant chose to sever a tie, they were shown their current alters’ total number of monetary units and the number of monetary units each alter donated to the participant in the previous round. (Following previous work8,37,66, participants were not given information on what their alters gave to others during the decision-making rounds. Doing so would have likely resulted in information overload.) Participants selected which tie to cut from this list of alters.
If a participant cut a tie, they were then given a list of all participants in the network to whom they were not currently tied, from which to propose a new tie. During this tie addition phase, participants could see prospective alters’ total number of monetary units. In the control condition, where political identities were not visible or known, reputation scores followed prior work4,5,8 and were simply the average number of monetary units a prospective alter donated to each of their neighbors in the previous three rounds. In the three experimental conditions, they could also see each prospective alter’s self-identified political affiliation (red for Republicans and blue for Democrats), and the average number of monetary units they gave their ties—either all ties (undifferentiated reputations condition), only ingroup ties (parochial reputations condition), or ingroup and outgroup ties tallied separately (intra/intergroup reputations condition)—in the previous three rounds. These averages represent the alters’ reputations (i.e., their level of cooperation in previous rounds). Hence, which reputational information participants saw depended on the experimental condition to which they were assigned (see Table 1). For instance, in the intra/intergroup reputations condition, each prospective alter had two reputation scores—one for how the alter treated their own ingroup members and one for how the alter treated their own outgroup members. In the parochial reputation condition, prospective alters’ reputation scores were based solely on how the alter treated their (alter’s) own ingroup members. For example, if ego was a Democrat and a given prospective alter was a Republican, the ingroup score would be the average number of monetary units given to Republicans over the previous three rounds. Screenshots in the SI show how reputation scores were displayed depending on experimental conditions.
From this list of potential alters, the participant selected a new alter to send a tie request to. Prospective alters who received a tie request then decided whether to approve or deny that request. (There were no constraints on the number of tie requests any given participant could receive and, if they chose, accept.) When deciding whether to approve a tie request, prospective alters could see the requesting player’s total number of monetary units, the number of monetary units they donated to each of their neighbors in the previous round, and, in the political identity visible conditions, the requesting player’s self-identified political orientation. Since ties between participants represented the only opportunities for interactions in the study, following prior work in this literature5,37,45,65, those whose tie initiations were denied did not have an opportunity to retaliate against the participant who denied the tie invitation.
If, as a result of tie updates, a participant lost all their ties, that participant would be isolated from the network, removed from the interaction phase of the study, and sent to the post-study questionnaire8,37,45. The SI presents results for network isolates.
Given that tie updates occurred only four times during the study, and each participant could only elect to add one alter in each phase, this presents a relatively conservative test of differences in network segregation between conditions. Further, note that this design limits broader strategic considerations of network formation74,75. That is, following closely related work8,9,37,56, participants in our studies can benefit from each additional tie formed, as long as that tie is cooperative. Thus, while participants have an incentive to strategically build their ego networks, there is a limited strategic incentive to form or delete ties in order to affect the broader social network and their location in it75,76.
The study lasted 18 rounds. But to avoid end-game effects, participants were not told this. After completing the 18 rounds, or becoming isolated from the network, participants completed the post-study questionnaire. At the end of the study, participants were paid $2 for passing the comprehension check quiz, $1 for successfully starting the study, and $1 for every 1000 monetary units accrued during the interaction phase.
Statistical analyses
A note about network dependence
Here we discuss our estimation strategy. When we examine behaviors within networks, and behaviors within networks through time, we violate standard assumptions about observations being (conditionally) independent. Network structure and temporal dependence both induce dependence. The cooperative behaviors of participants, for example, are affected by the behavior of their neighbors. We can evaluate this more formally, testing for network dependence among cooperative behaviors. Lee and Ogburn recommend comparing the observed network dependence to a distribution of dependence based on chance77. We computed whether there was significant (p < 0.05) network dependence among cooperation values for each network round of our data. Figure S1 shows the count of networks (out of the 10 in each condition) that had significant levels of network dependence. By round two we see high levels of network dependence.
Common strategies for adjusting for network dependence include incorporating network structure via covariates or transitioning to non-parametric inference78. In the context of non-parametric inference for regressions, it is preferable to permute model residuals78. In our case, however, we have a longitudinal structure as well: we observe cooperation and other behaviors through time. Such serial correlation in the outcome can also invalidate inferences. In light of these differential sources of nesting, we include variance components to adjust for temporal nesting (i.e., serial correlation) while permuting our outcome to adjust for network dependence. Each model description includes a note about the resampling scheme. Because we rely on these nonparametric methods, we do not estimate the standard errors associated with our regression coefficients and instead, base inferences on comparisons of the observed regression coefficients to a distribution of coefficients from resampling on our dependent variables. A consequence of not having standard errors includes the inability to estimate confidence intervals and effect sizes for most outcomes (exceptions include analyses reported in Tables S2 and S11). Supplementary Note 1 of the SI reports a range of sensitivity analyses that illustrate the robustness of the findings reported in the Main Text.
Cooperation
All statistical analyses are two-tailed. Figure 1A shows average cooperation rates through time for each experimental condition. Consistent with past work on dynamic networks4,8, we observe high levels of cooperation at the end of the study. Early on, however, differences in cooperation patterns and corresponding network dynamics may shape aggregate outcomes. To investigate cooperation before equilibrium, we modeled cooperation in rounds 1–8. Table 3 presents three linear mixed models predicting cooperation decisions with each alter. In this specification, alters are nested in participants, and participants are nested in networks. We also included an AR(1) specification to adjust for serial correlation79. We predict cooperation as a function of political similarity and experimental conditions in Model 1 and include their interaction in Model 2. Model 3 adjusts for direct reciprocity since direct reciprocity has powerful effects on cooperation2,44. We operationalize direct reciprocity as the amount the participant received from their partner in the previous round. As such, all first interactions with partners are missing on this variable. Inference is based on permuting cooperation within network-rounds 1000 times and computing the proportion of permutation-based coefficients that exceed the observed ones in magnitude. Margins for Fig. S2 are drawn from the model with only main effects (Model 1), and margins for Fig. 1B are drawn from the model with the interaction effect included, controlling for direct reciprocity (Model 3). Because our model-based estimates of variance are inconsistent due to nesting77, we cannot rely on the popular Delta method to estimate the uncertainty associated with marginal cooperation. Instead, we use bootstrapping, sampling 90% of the network-rounds with replacement, computing the margin, and then repeating this 1000 times. The inner 95% of the bootstrapped distribution serves as the bounds of uncertainty in Figs. S2 and 1B.
Whether to drop an alter
Figure S3 shows the proportion of participants who opted to drop an alter for each tie deletion phase by experimental condition. Participants in the intra/intergroup reputations condition were least likely to drop an alter. Those in the control condition approached the intra/intergroup condition by the second tie update phase, but then dropped more alters in phases 3 and 4. We modeled these proportions with mixed effects logistic regression, with time in participants, and participants in networks. Inference in this model is based on permuting whether to accept ties within network rounds. As shown in Table S1, after controlling for round, the number of partners, the amount given, the amount received, and the proportion of the participant’s network that shares a political identity, we find significant effects for the experimental condition. Figure S4 shows the probability of dropping an alter by condition. The bootstrapped distribution of margins came from sampling 90% of the data with replacement 1000 times. We find that participants in the inter/intra group condition are the least likely to drop an existing alter, those in the parochial condition are the most likely to drop an existing alter, and those in the control and undifferentiated conditions are in between and about equally likely to drop an alter.
Which ties were severed?
Conditional on deciding to drop an alter, participants then selected one of their current alters to drop. Figure S5 shows average (A) cooperation and (B) ingroup effects by whether the alter was dropped and the experimental condition. Figure S5A shows that those who were dropped were less cooperative across experimental conditions, and Fig. S5B shows that those who were dropped were less likely to be ingroup members in the undifferentiated and parochial reputation conditions. We model participant decisions to drop an alter as a conditional logistic regression, sometimes called fixed effects logistic regression80. We model the selection process as a function of alter endowments, how much the participant received from the alter (i.e., direct reciprocity), the alter’s reputation, and whether the alter is homophilous. Results are reported in Table S2. In Model 2, we include a participant-level variable denoting experimental conditions. While the main effect for this term cannot be estimated, the interaction effect with the same party can be, and that tells us how the ingroup effect changes with the condition. Estimates of the ingroup effect from Model 2 generated Fig. 2A. In this case only we rely on normal theory estimation since permuting who the participant dropped does not work (participants had ~4.5 ties, so 1000 permutations of this is not a realistic distribution). We use the sandwich estimator to generate standard errors81.
We observe the largest ingroup effect in the parochial reputation condition. To illustrate, we computed the probability that a participant would select an outgroup member when choosing between (for simplicity) a single ingroup and a single outgroup member. Figure S6 illustrates the implications of the ingroup effect on dropping alters, showing the marginal probability of dropping the outgroup member at various levels of independent variables. We set their endowment and reputation to the mean, and systematically varied how much a hypothetical ingroup/outgroup pair gave the participant, and computed the probability the participant would select the outgroup member.
New alter selections
Once participants decided which of their current alters to drop they were shown a list of all available alters and asked to propose a new tie to one of them. Figure S5 shows (C) average cooperation and (D) the proportion of same party others for tie proposals. Figure S5C shows that those alters who were selected by participants for new ties were more cooperative than those alters who were not selected. Similarly, Fig. S5D shows that selected alters were more likely to share a political party in all our experimental conditions. As with the choice model above, we use conditional logistic regression to model alter selection from the pool of available alters. Here, however, the pool of available alters was large enough to permute so we rely on non-parametric inference. We model alter selection as a function of alter endowments, same-party effects, and reputations. Endowments were z-transformed within rounds because they increased over time.
As noted above, the information available to participants varied by experimental condition. Participants in the control and undifferentiated reputations condition saw the average amount potential alters’ neighbors received from them. In the parochial condition, participants saw only the average amount given to alters’ same-party neighbors. In the intra/intergroup condition, participants saw the average amount alters gave to same-party neighbors and the average amount alters gave to opposite party neighbors. Given that this information varied with condition, we are unable to model these data simultaneously without excluding the variable for reputations. As such, Table S3 presents four conditional logistic regression models, estimated separately for each experimental condition. Each model includes the relevant variable(s) for reputation information for that condition. The marginal effects of same-party others in all three models are depicted in Fig. 2B and were generated using a bootstrapped sample of individual choices (90%, with replacement). Figure S7 illustrates the effect of same party others on alter selection in the undifferentiated reputations condition. As above, we set endowments to their mean and varied only the relevant reputation score of a single ingroup and a single outgroup member to illustrate the probabilities of selection.
Accepting tie requests
As described in the main text, we find that accepting pending tie requests is primarily driven by the requester’s reputation. As shown in Table S4, neither the main effect nor any of the interaction terms with experimental conditions are significant for same-party effects.
Network measures
As noted in the main text, network clustering is defined as the probability that adjacent nodes are connected47. We computed this using the transitivity function in the igraph package for R82. Similarly, segregation is defined as having fewer between group ties than expected by chance given the density of the network48. We computed it using the freeman function in the netseg package for R83,84.
Becoming isolated from networks
Participants could have become excluded from our study for multiple reasons. If participants did not respond to the application within 10 s of being prompted, participants were dropped to avoid entire networks from crashing. This may have happened due to internet connectivity, for example. But, of the 1073 participants who began our study, 855 completed it. Of the 1073 participants who began our study, 139 of them were isolated from experimental networks due to network dynamics. That is, they began a tie update phase with at least one alter and ended that phase with none, isolating them from the network. The SI models network isolation.
After becoming isolated, participants were sent to the post-study questionnaire. Figure S8 shows the count of isolates observed by experimental conditions for each tie update phase. We do not observe any systemic patterns in the Figure. Table S5 presents the results of a Cox proportional hazards model, predicting the hazard of participants becoming isolated from our networks. Due to the possibilities of network dependence shaping our hazard model results, estimates of uncertainty in Table S5 come from permuting the time-relevant variables for participants, holding the network constant again. We find that participants who gave more and who had larger endowments were less likely to become isolated from the networks, but that experimental condition is unrelated to network isolation.
Missing data
As noted above, of the 218 participants who did not complete our study, 139 of them became isolated and the remaining 79 dropped out for other reasons (e.g., internet connectivity). If these drop-outs occurred systematically, there might be concerns about sample selection. Table S6 shows how the 79 dropouts were distributed across our experimental conditions. Row 1 shows that the fewest dropouts were in the control and the most dropouts were in the intra/intergroup condition. Importantly, the distribution of dropouts is not significantly different from a uniform distribution (\({\chi }_{(3)}^{2}\) = 6.42, p = 0.093, univariate Chi-squared test). In the control condition, we did not have participant’s political affiliation (because this was measured in a post-study questionnaire). In the experimental conditions, we asked this question before participants were allocated to networks, so we can assess whether dropping out varies by politics. Table S6 also shows dropouts by political affiliation (except for the control condition). There were 34 Republicans and 34 Democrats who dropped out. While there are some differences by experimental condition, the count of dropouts by political affiliation and the experimental condition is not significant either (\({\chi }_{(3)}^{2}\) = 5.61, p = 0.132, bivariate Chi-squared test).
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.