Social network characterization

Subjects in part 1 of the study (social network characterization) were 279 (89 females) first-year students in a graduate program at a private university in the United States who participated as part of their coursework on leadership. The total size of the graduate cohort was 279 students (i.e., all students in the cohort participated in the leadership course); a 100% response rate was obtained for part 1 of the study, which was done in accordance with the standards of the local ethical review board. The social network survey was administered during November of students’ first academic year in the graduate program, which began the preceding August. Therefore, subjects had been on campus together for 3–4 months prior to completing the social network survey, and friendships reported on the survey would have been formed either during subjects’ first few months on campus or prior to entering the graduate program.

In order to characterize the social network of all first-year students, an online social network survey was administered. Subjects followed an e-mailed link to the study website where they responded to a survey designed to assess their position in the social network of students in their cohort of the academic program. The survey question was adapted from Burt48 and has been previously used in the modified form used here11,49,50. It read, “Consider the people with whom you like to spend your free time. Since you arrived at [institution name], who are the classmates you have been with most often for informal social activities, such as going out to lunch, dinner, drinks, films, visiting one another’s homes, and so on?” A roster-based name generator was used to avoid inadequate or biased recall. Classmates’ names were listed in four columns, with one column corresponding to each section of students in the graduate program. Students’ names were listed alphabetically within section. Subjects indicated the presence of a social tie with an individual by placing a checkmark next to his or her name. Subjects could indicate any number of social ties, and had no time limit for responding to this question. The social network of the cohort is illustrated in Fig. 1. The social network survey used here only inquired about students’ interactions with other members of their academic cohort. Subjects undoubtedly have interactions with individuals outside of their cohort of classmates that this survey did not measure (e.g., with family members, prior colleagues, friends from before they entered the program, etc.). We note that the current study was conducted at a relatively small and remotely located institution where subjects’ contacts outside of campus likely play a smaller role in their daily lives compared to their quotidian, face-to-face interactions with their classmates. That said, social distances between some subjects who did not report friendships with one another may be underestimated due to indirect connections through individuals outside of the graduate cohort.

In addition, demographic data about each subject’s gender, ethnic identity, and country of citizenship were obtained from the school’s registrar. Personally identifying information was removed from these data; subjects’ demographic, social network, and neuroimaging data were linked only by anonymous ID numbers.

Social network analysis was performed using the R package igraph51,52. An unweighted, undirected graph consisting only of reciprocal (i.e., mutually reported) social ties was used to estimate social distances between individuals. For example, an undirected edge would connect two actors, person i and person j , only if person i and person j each nominated the other as a friend. If person i nominated person j , but person j did not nominate person i , or vice versa, these actors were not considered friends for the purposes of this study. Social distance was operationalized as the smallest number of intermediary, mutual social ties required to connect two individuals in the network (i.e., geodesic distance). Pairs of individuals who both named one another as friends were assigned a social distance of one. An individual would be assigned a distance of two from a given subject if he or she had a mutually reported friendship with that subject’s friend, but not with the subject him or herself, and so on. The distribution of social distances for all pairs of fMRI study subjects is provided in Supplementary Fig. 1.

fMRI study subjects

Forty-two subjects (12 female; 3 left-handed) aged 25–32 (M = 27.98; SD = 1.72) who had completed part 1 of the study completed a subsequent neuroimaging study (part 2). Students were informed during class about the opportunity to participate in an fMRI study involving viewing visual stimuli. They were informed that they would receive $20 per hour as compensation for their time, as well as anatomical images of their brains. All students who were interested in participating and were not affected by standard safety-related contraindications for MRI (e.g., the presence of metallic implants) participated in the neuroimaging study. All subjects were fluent in English and had normal or corrected-to-normal vision. Because subjects were not allocated to experimentally defined groups in the current study, blinding investigators to between-subject conditions and random assignment of subjects to conditions were not applicable. Subjects provided informed consent in accordance with the policies of the local ethical review board. Data collection for the neuroimaging study began mid-way through February during subjects’ first academic year in the graduate program, and all scanning was completed within 2 weeks. Therefore, all neuroimaging data was collected ~3 months after the collection of the social network data.

fMRI data acquisition

Subjects were scanned using a 3 T Philips Achieva Intera scanner with a 32-channel head coil. An echo-planar sequence (35 ms echo time (TE); 2000 ms repetition time (TR); 3.0 mm × 3.0 mm × 3.0 mm resolution; 80 × 80 matrix size; 240 × 240 mm field of view (FOV); 35 interleaved transverse slices with no gap; 3.0 mm slice thickness) was used to acquire functional images. Stimuli were presented over the course of six functional runs. Functional runs consisted of 204, 276, 194, 147, 189, and 108 dynamic scans, for a total functional data acquisition time of approximately 33.7 min, excluding time between functional runs. A high-resolution T1-weighted anatomical scan was also acquired for each subject (8.2 s TR; 3.7 ms TE; 240 × 187 FOV; 0.938 mm × 0.938 mm × 1.0 mm resolution) at the end of the scanning session. Foam padding was placed around subjects’ heads to minimize head motion.

fMRI study paradigm

Prior to being scanned, subjects were informed that they would be watching a series of videos while in the scanner. Subjects were informed that these videos would be brief and would vary in content, and that the experience of participating in the study would be analogous to passively watching television while someone else “channel surfed.” Videos were presented in the same order to all subjects in order to avoid inducing inter-subject response variability that would be attributable simply to differences in the manner in which clips were presented in the experiment (e.g., if a serious video happened to be preceded by a comedic clip for some subjects and not others). Given that the current study aimed to test if subjects’ positions relative to one another in their social networks are associated with neural response similarity, rather than to contrast responses to particular stimuli, the benefits of using a single trial order for all subjects were judged to outweigh potential costs. After the scanning session had concluded, the experimenter interviewed each subject to determine if he or she had previously seen any of the video clips used in the experiment.

fMRI study stimuli

Stimuli consisted of 14 videos presented with sound over the course of six fMRI runs. Videos ranged in duration from 88 to 305 s (Table 1). Three principal criteria were used to select video clips as stimuli. First, we sought to select stimuli that subjects in our sample would be relatively unlikely to have seen before. This was done in order to avoid inducing differences in inter-subject correlations due to simple familiarity with the stimuli, given that friends may be more likely to have seen the same videos prior to the experiment compared with pairs of individuals who are not friends with one another.

Second, we sought to select engaging stimuli. We reasoned that insufficiently engaging stimuli would be likely to evoke mind wandering, which would likely involve idiosyncratic thoughts unrelated to the experiment, and thus would introduce unwanted noise into estimates of inter-subject correlations and their relationships to social distance. In contrast, stimuli that effectively engage an audience do so by directing and constraining viewers’ thoughts and associated neural activity. As such, professionally directed movies and television shows elicit more reliable responses within and across subjects than unedited video footage or series of static photographs38. Such videos are engineered to engage viewers’ attention and drive their inferences by inducing particular reactions and interpretations at specific times, and thus, are well-suited for experiments seeking to induce a shared series of cognitive states across subjects18.

Third, we sought to select stimuli that, while engaging, would also introduce meaningful variability in inter-subject correlations. We reasoned that for the purposes of the current study, uninformative inter-subject variability in neural response time series data would arise largely from using stimuli that failed to effectively engage subjects, and thus, failed to constrain their thoughts and attention. In contrast, meaningful inter-subject variability in neural response time series data would arise from using stimuli that produced diverging inferences and patterns of attentional allocation in different sets of viewers. We sought to select stimuli that minimized uninformative inter-subject variability by engaging subjects’ attention, but at the same time, promoted meaningful inter-subject variability by evoking divergent reactions across subjects. For example, videos were chosen that might be interpreted as sweet by some subjects, but cloying or “sappy” by others (e.g., a sentimental music video), that would appeal to different styles of humor (e.g., physical comedy, wry humor, “cringe” comedy, and sophomoric or “lowbrow” humor), and that presented one or both sides of an argument that subjects might resonate with or respond to with criticism (e.g., a debate about whether college football should be banned). Brief descriptions of all 14 videos are presented in Table 1.

The majority of subjects (29 of 42) had not seen any of the video clips used in the fMRI study prior to participating, and the average number of clips subjects had seen before was low (M = 0.41 clips out of 14; SD = 0.70). For the majority of videos used as experimental stimuli (i.e., 9 of 14), there were no dyads whose members had both seen the clip prior to scanning. Of the remaining video clips, two had previously been seen by two subjects (i.e., by both members of a single dyad, or 0.12% of all dyads), two had been seen previously by three subjects (i.e., by both members of three dyads, or 0.35% of dyads), and one clip had been seen previously by four subjects (i.e., by both members of six dyads, or 0.70% of the 861 total dyads). Please refer to Supplementary Table 1 for a complete summary of subjects’ reported familiarity with the 14 video clips used as experimental stimuli, and Supplementary Note 4 for a replication of our main analyses excluding dyads whose members had both seen any of the same stimuli prior to participating in the fMRI study.

Defining anatomical ROIs

Anatomical regions were delineated by applying the FreeSurfer anatomical parcellation algorithm53 to each subject’s high-resolution anatomical scan (Fig. 2a). Briefly, this process includes the digital removal of non-brain tissue, automated segmentation of the cerebral cortex, subcortical white matter, brainstem, cerebellum, and deep gray matter volumetric structures (e.g., amygdala, hippocampus, and putamen), generation of a model of each subject’s cerebral cortical surface, and automated parcellation of each subject’s cortical surface model into anatomical units based on his or her cortical folding patterns. The Desikan–Killiany cortical atlas32 as implemented in FreeSurfer 5.353 was used to assign anatomical labels to each subject’s cortical surface model. This gyral-based atlas defines a gyrus as tissue between two adjacent sulci. As such, a particular gyral label in this atlas (e.g., left inferior temporal gyrus) corresponds to both the associated gyrus and the adjacent banks of its limiting sulci. This procedure yielded 34 atlas labels for each hemisphere, as well as 6 labels corresponding to subcortical structures within each hemisphere. Thus, in total, 80 anatomical ROIs were defined for each subject (Supplementary Table 2 and Fig. 3 for a complete list of ROIs).

Preprocessing of fMRI data

Preprocessing of fMRI time series data was performed using AFNI54. For each run, functional data were despiked using the AFNI program 3dDespike to remove transient, extreme signal fluctuations not attributable to biological phenomena. Next, each subject’s functional scans were aligned to his or her anatomical scan using a six-parameter rigid body least squares transformation. Motion parameters from this volume registration step were saved for later removal from the signal time series as regressors of no interest. The first two volumes of each run were discarded in order to avoid including data potentially characterized by large signal changes prior to tissue reaching a steady state of radiofrequency excitation. Each voxel’s time series was scaled to its mean within each run.

In addition to motion parameters extracted during volume registration, time series from voxels corresponding to white matter and ventricles were extracted for later inclusion as regressors of no interest, as signal fluctuations in white matter and cerebrospinal fluid largely reflect noise due to subject motion, instrument instabilities, and physiological artifacts, such as cardiac and respiratory effects55,56. White matter and ventricle masks were extracted based on each subject’s FreeSurfer segmentation file. These masks were eroded to avoid inclusion of gray matter voxels by excluding any voxels with one or more non-white matter neighbors from the white matter mask, and any voxels with two or more non-ventricle voxel neighbors from the ventricle mask. A relatively less conservative erosion threshold was applied to the ventricle masks to ensure that all subjects’ ventricle masks contained voxels; these thresholds were chosen based on the recommendations provided by afni_restproc.py. Data were spatially smoothed separately within gray matter and non-gray matter masks using a 4-mm full width at half maximum Gaussian smoothing kernel. The average time series from each run was extracted from the ventricle mask for use as a global regressor of no interest. In addition, a local regressor of no interest was computed for each voxel by taking the average time series of white matter voxels within a 15-mm radius of that voxel. The temporal derivatives of each regressor of no interest (i.e., motion parameters extracted during volume registration, average ventricle signal, and local white matter signal) were computed for use as additional regressors of no interest. Next, a third-order polynomial was removed from all regressors of no interest to avoid the inclusion of competing polynomial terms during the subsequent regression.

Finally, nuisance signals (i.e., motion parameters, average ventricle signal, local white matter signal, and their derivatives) and a third-order polynomial were regressed out of the preprocessed time series of each voxel for each run for each subject. The goal of this procedure was to remove signal changes dues to subject motion, physiological artifacts (e.g., respiration and cardiac effects), and instrument instabilities in order to provide a better estimate of signal fluctuations due to neural processing. Nuisance variable regression is often employed to attenuate temporal autocorrelation characterizing fMRI response time series, which can bias estimates of error variance and thus, the significance of test statistics describing those time series, due to an underestimation of the true degrees of freedom57. In the current study, however, the relative magnitudes of correlation coefficients between corresponding time series (which, unlike corresponding p-values would not be biased by temporal autocorrelation within individual time series) were entered into separate statistical analyses investigating how dyadic similarity varied as a function of social distance. Thus, removing the effects of the nuisance variables as described above served primarily to decrease noise in the data unrelated to cognitive and affective processing of the stimuli. For each subject, these preprocessed time series data were concatenated across all six experimental runs. The average preprocessed time series from each of the 80 anatomical ROIs was extracted for each subject (i.e., data were averaged across all voxels within a given ROI at each time point for each subject).

Due to coverage issues, five subjects were missing data for 1 or more ROI. Specifically, two subjects were missing data for a single ROI, one subject was missing data for 2 ROIs, one subject was missing data for 6 ROIs, and one subject was missing data for 21 ROIs. Missing data were concentrated primarily in the temporal lobes (Supplementary Table 2).

Extracting dyadic similarities of fMRI response time series

Given that there were 42 subjects in the fMRI component of the study, there were 861 unique (undirected) dyads of fMRI subjects. For each of these 861 dyads, the Pearson correlation between the time series of their fMRI responses was computed for each of 80 anatomical ROIs (Fig. 2). For 1259 of these 68 880 total data points (i.e., 861 subject pairs×80 anatomical ROIs), at least one subject in the dyad lacked data for the corresponding ROI (Supplementary Table 2). In such cases, the correlation value for this dyad was imputed as the average correlation value for that ROI from all remaining dyads. The resulting similarity vectors for each of the 80 anatomical ROIs were normalized to have a mean of zero and a SD of 1 (Fig. 3).

Predicting social distance based on neural similarities

As described in the main text, we tested if it would be possible to predict whether two individuals were friends, friends of friends, or farther apart in the social network based on the similarities of their fMRI response time series. If so, it should be possible to build a predictive model of social distance by training an algorithm to recognize patterns of neural similarities associated with various social distance categories from a subset of dyads’ data. This model should then correctly generalize to predicting the social distances characterizing new dyads given data summarizing the similarity of those dyads’ fMRI responses to naturalistic stimuli (i.e., from the eighty-element vectors that summarize the similarities of neural responses for each dyad). Given that the current data were imbalanced across social distance categories (i.e., n = 63 for distance 1 dyads; n = 286 for distance 2 dyads; n = 412 for distance 3 dyads; and n = 100 for distance 4+ dyads), data resampling and folding procedures were used to create a series of balanced data folds such that all dyads were included in the analyses, as described in more detail below.

First, the data set was divided into eight training and test folds using the StratifiedKFold function in scikit-learn24, which ensures equivalent percentages of samples of each class across training and test folds. To attenuate problems of class imbalance, sampling techniques such as undersampling (i.e., omitting examples of over-represented classes from the data set) and oversampling (i.e., adding copies of examples from under-represented classes to the data set) are often used. Undersampling can entail excluding a large amount of data from analyses (e.g., in the current study, including only 63 examples of each category would entail using only 252 dyads’ data, effectively excluding 609 dyads—71% of the total data set). Oversampling ensures that all examples (here, all dyads’ data) are included in analyses. Here oversampling was implemented within each training fold to generate equal numbers of dyads of each social distance category within each training fold. Distance categories containing relatively few dyads within each training fold were made equivalent in size to the larger social distance categories by iteratively sampling randomly without replacement from the examples of the corresponding distance category within that training fold until there was an equivalent number of data points from each category within the training fold. This approach ensures that no data points are entirely excluded from analysis, while ensuring that any overfitting resulting from oversampling will not artificially inflate cross-validated model performance, since oversampling is performed only within each training fold and performance is ultimately assessed within the previously held-out testing data from each fold.

Within the training data of each data fold, a grid search procedure was implemented in scikit-learn24 to select the hyper-parameter (i.e., the value of the C parameter from a grid of logarithmically spaced values between 0.001 and 1000) of a linear SVM learning algorithm that would best separate items in the training data set according to social distance. More specifically, the training data within each data fold was subdivided into eight additional data folds that were each partitioned into training and validation data sets, and the C value that performed most accurately on validation data across folds within the training data was selected as the best estimator for that data fold. The best estimator was then retrained on all training data from the given data fold, and its out-of-sample predictive performance was tested on the left-out testing data for that data fold. This process was repeated iteratively for each data fold. Results in the main text reflect the average cross-validated predictive performance across data folds.

To compare the actual cross-validated predictive performance to what would be expected based on chance alone, permutation testing was used. The procedure described above was repeated 1000 times while randomly shuffling the labels corresponding to the data in each training fold to estimate a null distribution of cross-validated prediction accuracies corresponding to what would be achieved by random guessing. The distribution and mean of the cross-validated predictive accuracies achieved in the randomly permuted data are illustrated in Fig. 8b.

Data visualization was performed using the python packages PySurfer58, seaborn,59 and Matplotlib60, as well as the R packages igraph52 and ggplot261.

Code availability

The code used for the analyses also is available upon request.

Data availability

The data that support the findings of this study are available from the corresponding author upon request.