## Abstract

Understanding how student peers influence learning outcomes is crucial for effective education management in complex social systems. The complexities of peer selection and evolving peer relationships, however, pose challenges for identifying peer effects using static observational data. Here we use both null-model and regression approaches to examine peer effects using longitudinal data from 5,272 undergraduates, where roommate assignments are plausibly random upon enrollment and roommate relationships persist until graduation. Specifically, we construct a roommate null model by randomly shuffling students among dorm rooms and introduce an assimilation metric to quantify similarities in roommate academic performance. We find significantly larger assimilation in actual data than in the roommate null model, suggesting roommate peer effects, whereby roommates have more similar performance than expected by chance alone. Moreover, assimilation exhibits an overall increasing trend over time, suggesting that peer effects become stronger the longer roommates live together. Our regression analysis further reveals the moderating role of peer heterogeneity. In particular, when roommates perform similarly, the positive relationship between a student’s future performance and their roommates’ average prior performance is more pronounced, and their ordinal rank in the dorm room has an independent effect. Our findings contribute to understanding the role of college roommates in influencing student academic performance.

### Similar content being viewed by others

## Introduction

Peer effects, or peer influence^{1,2,3,4,5}, have long been studied in the literature on social contagions^{6,7,8,9,10,11} and education^{12,13,14,15,16,17,18}. Understanding the influence of student peers on social behavior and learning outcomes is crucial for effective education management^{18,19,20,21,22}, as it can inform policy decisions on how to improve learning environments inside and outside the classroom^{23,24,25,26,27,28}. Student peers can have both positive and negative effects, depending on their characteristics and behaviors^{29,30}. For example, when surrounded by high-achieving peers, students may be motivated to improve their academic performance^{31,32}. Meanwhile, some well-known examples of human behaviors adopted through social influence, such as smoking^{33,34}, substance abuse^{35,36}, and alcohol use^{37,38,39}, are often associated with negative student performance. Moreover, student peers may have indirect and lasting effects, for instance, on political ideology^{40}, persistence in STEM majors^{41,42,43,44,45}, occupational preferences^{46}, labor market outcomes^{47,48,49}, and earnings^{50,51,52,53}. A thorough understanding of peer effects on learning outcomes can inform education management strategies, such as implementing behavioral interventions to mitigate the negative influence of disruptive peers^{54,55}. Yet, using traditional methods and observational data to study peer effects causally is a challenge.

Dynamic educational and social environments make it difficult to separate peer influence from peer selection due to reverse causality, confounding factors, and complex mechanisms^{1,2,3,56}. In particular, similarities in academic performance among student peers may be due to homophily (i.e., the selection of peers based on academic performance similarity) rather than the influence of peers^{57,58,59}. Unlike open and evolving educational environments such as classrooms^{23,24,25,26}, dormitories in universities provide a close-knit living environment for students to interact and potentially learn from each other^{60,61}. While dorm rooms may not be the primary learning place like classrooms and libraries, they offer a highly interpersonal and spillover environment for a small group of stable student peers. In contrast to Western universities, in which freshman students usually have the flexibility to choose dormitories and suite-mates according to their lifestyle and personal preferences, most Chinese universities randomly assign students to dorm rooms^{61,62,63}. There, a typical 4-person dorm room contains four beds and some public areas, providing a more interactive environment than a Western dorm suite containing four separate bedrooms (Supplementary Fig. 1).

Research on student peer effects, on the one hand, has primarily relied on static observational data of campus behaviors and performance metrics^{11,64}. This reliance stems from various factors, such as the high cost and impracticality of conducting large-scale field experiments in learning environments, the dynamic nature of peer relationships^{65}, and the scarcity of longitudinal data on student learning outcomes^{66,67,68,69,70}. The close-knit dormitory environment of Chinese universities, however, provides a unique opportunity to observe a stable group of student peers and track their academic performance over time^{61,63}. On the other hand, while regression models are widely employed in studying peer effects within the social sciences, methodologies from other disciplines may help expand the functional form in which peer effects can be estimated^{64}. Particularly, null models are well suited for studying nontrivial features of complex systems by providing an unbiased random structure of other features^{71,72,73}. Null-model approaches have been applied to test causal effects in complex social systems^{74,75,76}. For instance, in the social network literature, randomizations are used to study the impact of network interventions on social relationships^{77}. Utilizing a null model to test whether roommates exhibit similar performance could offer a promising approach to identifying peer effects and quantifying their magnitude, facilitating comparisons across diverse datasets.

One advantage of regression models is their capability to address the issue of inverse causality by utilizing longitudinal data and controlling for confounding factors^{68,78}. For example, a student’s future performance may be influenced not only by the average prior performance of roommates but also by their own prior performance. Additionally, the composition of roommates may have independent effects^{79}. Yet, it remains relatively less explored whether the heterogeneity in performance among roommates provides a ladder for the student to catch up with high-achieving roommates or hamper their motivation due to the inconsistent signal from roommates or the negative impact of disruptive roommates^{29,30}. Moreover, dorm rooms provide an interactive yet local environment where a student’s ordinal rank in the dorm room, conditional on academic performance, may independently affect learning outcomes^{80,81}. Therefore, a more comprehensive understanding of the factors contributing to roommate peer effects may help inform education policy and student management strategies, such as designing interventions for dormitories that effectively leverage the influence of high-achieving peers in improving student performance.

In this study, we quantify roommate peer effects using both null models and regression approaches to analyze a longitudinal dataset of student accommodation and academic performance. Sourced from a public research-intensive university in China, our data covers 5,272 undergraduate students residing in 4-person dorm rooms following the random assignment of roommates (see “Methods”). The initialization is plausibly random since the roommate assignment takes into account neither students’ academic performance before college admission nor their personal preferences, and there is no significant reassignment later (see Supplementary Information Section 1.2 for details). Here, we demonstrate the presence of roommate peer effects by showing that roommates with similar performance are more likely to be observed in the actual data than expected by chance alone. We then measure the size of roommate peer effects by developing an assimilation metric of academic performance and contrasting its value in the actual data with that in the roommate null model that we construct by randomly shuffling students among dorm rooms while retaining their controlled characteristics. Further, we use regression models to examine factors influencing roommate peer effects and explore the role of peer heterogeneity in moderating the effects.

## Results

### Tier combinations within a dorm room

We start by studying the roommate composition of a typical 4-person dorm room in terms of their academic performance. For comparisons across student cohorts (i.e., those who were admitted by the university in the same year), majors, and semesters, we transform each student’s grade point average (GPA) in a semester into the GPA percentile *R* among students in the same cohort and major, where \(R\) = 0 and \(R\) = 1 correspond to the lowest and highest academic performance, respectively. We then divide students into equal-sized tiers based on their GPA percentiles, where those with better performance are in larger tiers. For instance, under the 4-tier classification, students with \(R\) = 0.3 (i.e., GPA is above 30% of students) and \(R\) = 0.9 (i.e., GPA is above 90% of students) are in Tier 2 and Tier 4, respectively. Accordingly, each dorm room has a tier combination without particular order. For example, 3444 (i.e., one student is in Tier 3, and the other three are in Tier 4) is identical to 4344 and 4434. Here we use the one in ascending order of tier numbers to delegate all identical ones. Under the 2-tier classification, there are five unique tier combinations (1111, 1112, 1122, 1222, and 2222). The numbers are 15 and 35 under 3-tier and 4-tier classifications, respectively (Fig. 1a; see Supplementary Information Section 2.1 for details).

Given a tier for classification, the probability \({P}_{a}\) of observing a combination in the actual data can be calculated by the fraction of dorm rooms with the combination. The actual probabilities \({P}_{a}\) of observing different combinations (i.e., the frequency of observations), however, shouldn’t be directly compared. This is because their theoretical probabilities \({P}_{t}\) are not always the same even when the tier numbers of roommates are independent of each other, i.e., there is no roommate peer effect (see Supplementary Table 1 and Supplementary Information Section 2.1). To give a simple example: under the 2-tier classification, the theoretical probability \({P}_{t}\) of combination 1112 is \({C}_{4}^{1}{\left(\frac{1}{2}\right)}^{3}\left(\frac{1}{2}\right)=\frac{1}{4}\), which is four times as big as that of combination 1111, namely, \({\left(\frac{1}{2}\right)}^{4}=\frac{1}{16}\). This leads to the difficulty of assessing, by the value of \({P}_{a}\), whether a combination is over-represented or under-represented in the actual data. To address this challenge, we calculate the relative ratio \({\mathbb{E}}\) for a combination by comparing the actual probability with its theoretical probability:

where \({P}_{a}\) and \({P}_{t}\) are the actual and theoretical probability of the same combination, respectively. A positive (negative) value of \({\mathbb{E}}\) suggests that the combination is more (less) likely to be observed in data than expected by chance alone (see Supplementary Information Section 2.2).

We analyze the student accommodation and academic performance data under 2-tier, 3-tier, and 4-tier classifications and calculate the relative ratio \({\mathbb{E}}\) for each combination (Fig. 1a). We find that \({\mathbb{E}}\) of different combinations vary substantially and \({\mathbb{E}}\) of some combinations deviates significantly from 0 according to the results of statistical tests (see “Methods” and Supplementary Information Section 3.2 for details). For example, under the 2-tier classification, \({\mathbb{E}}\) of combinations 1111 and 2222 is significantly above 0 and \({\mathbb{E}}\) of combinations 1112 and 1122 are significantly below 0 (*P* value < 0.001; see Supplementary Table 2 for the statistical testing results for each combination). More notably, we find that combinations with the same or nearby tier numbers (e.g., 1111 and 1112) tend to have larger \({\mathbb{E}}\) and those with distant tier numbers (e.g., 1122) have smaller \({\mathbb{E}}\), prompting us to study the relationship between a combination’s tier heterogeneity and its \({\mathbb{E}}\). Specifically, we first calculate the relative difference \(D\) in the tier numbers for each combination:

where \({l}_{u}\) and \({l}_{v}\) is the tier number of roommates \(u\) and \(v\), respectively. A smaller \(D\) indicates that roommates have closer tier numbers and thus a smaller difference in their academic performance. We then group combinations with the same \(D\) and arrange them in ascending order of \(D\). We find that combinations with positive and negative \({\mathbb{E}}\) are overall separated (Fig. 1b), where those with a smaller \(D\) tend to have positive \({\mathbb{E}}\) (i.e., over-represented in the actual data) and those with a larger \(D\) tend to have negative \({\mathbb{E}}\) (i.e., underrepresented in the actual data). Inspired by this observation, we calculate the mean value of \({\mathbb{E}}\) for each group with the same \(D\), finding a negative relationship between \(D\) and \({\mathbb{E}}\) (Fig. 1c). These results demonstrate that roommates tend to have more similar academic performance than random chance, suggesting the presence of roommate peer effects.

### Assimilation of roommate academic performance

We generalize the tier combination analysis to the most granular tier for classification by directly dealing with the GPA percentile \(R\in\) [0, 1] (hereafter GPA for short). Specifically, similar to calculating the relative difference \(D\) in the tier combination for each dorm room, we develop an assimilation metric \(A\) to quantify the extent to which the GPAs of roommates differ from each other. Formally, the assimilation metric \(A\) for a 4-person dorm room is calculated by

where \({R}_{u}\) and \({R}_{v}\) are the GPAs of roommates \(u\) and \(v\), respectively. The assimilation \(A\) of a dorm room is between 0 and 1, with a larger value indicating that roommates have more similar academic performance. If there is no roommate peer effect, each roommate’s GPA should be independent and identically distributed (i.i.d.), and the theoretical assimilation \(A\) of all dorm rooms has a mean value of 0.5 (see Supplementary Information Section 4.1 for detailed explanations).

Inspired by permutation tests, often referred to as the “quadratic assignment procedure” in social network studies^{74,75}, we perform a statistical hypothesis test to check whether the assimilation of dorm rooms in the actual data deviates significantly from its theoretical value. Specifically, we proxy theoretical assimilation via null-model assimilation that is calculated based on a roommate null model and compare it with actual assimilation. An appropriate null model of a complex system satisfies a collection of constraints and offers a baseline to examine whether displayed features of interest are truly nontrivial^{71,72,73}. We start with the actual roommate configuration and randomly shuffle students between dorm rooms while preserving their compositions of cohort, gender, and major. By repeating this process, we construct a plausible roommate null model that consists of 1000 independent implementations (see Supplementary Information Section 3.1 for details). We find that the mean of actual assimilation (0.549) of all dorm rooms is 10.7% larger than that of null-model assimilation (0.496; Fig. 2a). A Student’s *t*-test confirms that the two assimilation distributions have significantly different means (*P* value < 0.001; see Supplementary Information Section 4.2 for details). These results suggest that roommate assimilation in academic performance is greater than expected by chance alone, demonstrating significant roommate peer effects.

The extent to which the mean of actual assimilation is larger than that of null-model assimilation indicates the magnitude of roommate peer effects, allowing us to examine temporal trends over the five semesters. First, we find that roommate peer effects remain significant when measured using data from each semester (see Supplementary Information Section 4.1 for details). Second, we hypothesize that before the first semester (i.e., the first day of college), roommate peer effects should be 0 due to the plausible random assignment of roommates, where the actual assimilation should be close to the null-model assimilation. As roommates live together longer and establish stronger interactions with each other, the actual assimilation of roommate academic performance would become larger, and the magnitude of roommate peer effects would become bigger. To test this hypothesis, for each semester, we calculate the percentage difference in the means of the actual assimilation and the null-model assimilation that is a proxy of roommate peer effects before the first semester (see Supplementary Information Section 4.1 for details). We find that the percentage difference exhibits an overall increasing trend over time (Fig. 2b), which supports the hypothesis that, as roommates live together longer, the magnitude of roommate peer effects on academic performance becomes larger. These results are robust when we use an alternative way to estimate the magnitude of roommate peer effects, where we calculate the share of dorm rooms with larger-than-null-model assimilation (see Supplementary Information Section 4.3 for details). Moreover, our further analysis shows that female and male students have similar assimilation, suggesting no significant gender differences (see Supplementary Information Section 4.4 for details).

### The effects of heterogeneous peers

The increasing assimilation of roommates in their academic performance raises a question about how a student’s future performance is impacted by their roommates’ prior performance, especially when there is substantial peer heterogeneity in performance, e.g., there are both high-achieving and underachieving roommates. To answer this question, we employ regression models to perform a Granger causality type of statistical analysis. Specifically, we first examine the relationship between a student’s post-GPA (GPA_Post; e.g., their own GPA in the second semester) and the average prior GPA of their roommates (RM_Avg; e.g., their roommate’s average GPA in the first semester) by calculating pairwise correlations for all consecutive semesters and dorm rooms. We find that dorm rooms tend to occupy the diagonal of the “GPA_Post – RM_Avg” plane (Fig. 3a), suggesting that a student’s post-GPA is positively associated with the average prior GPA of their roommates. We then use an ordinary least squares (OLS) model to study the relationship between GPA_Post and RM_Avg (see “Methods” for the empirical specification) and summarize the regression results in Table 1. We find that without controlling for the effects of other factors (see column (1) of Table 1), the average prior GPA of roommates has a significantly positive effect on a student’s post-GPA (regression coefficient *b* = 0.365; *P* value < 0.001; Fig. 3b).

Other factors may independently affect a student’s post-GPA and confound its association with the average prior GPA of their roommates. Therefore, we add controls and fixed effects into the OLS model (see “Methods”). The regression results shown in Table 1 convey several findings. First, a student’s prior GPA has the strongest effect on their post-GPA (\(b\) = 0.801, which is 16 times as large as \(b\) = 0.050 for roommate average prior GPA; see columns (2) of Table 1), suggesting a significant path dependence on academic achievement. Second, the positive effect of roommate average prior GPA on a student’s post-GPA remains significant with controlling the student’s prior GPA, gender, cohort, major, and semester (*P* value < 0.01; see column (2) of Table 1 and Fig. 3c). Notably, female students perform better than male students on average (see Supplementary Information Section 4.4 for details). Third, the differences in roommate prior GPAs (RM_Diff) have no significant effect (*P* value > 0.1; see columns (3) and (4) of Table 1), but it significantly moderates the relationship between roommate average prior GPA and post-GPA (see column (5) of Table 1 and Fig. 3d) such that their positive relationship is more pronounced (slope *b* = 0.055; 95% CI = [0.040, 0.070]) when RM_Diff is high (i.e., 1 SD above its mean) and less pronounced (slope *b* = 0.028; 95% CI = [\(-\)0.001, 0.057]) when RM_Diff is low (i.e., 1 SD below its mean; see Supplementary Information Section 5.1 for detailed results of a simple slope test). The result also shows that high post-GPA is associated with large differences in the roommate’s prior GPA when the roommate’s average prior GPA is low (see the red line on the lower left of Fig. 3d).

While the regression results suggest that roommate peer effects are significant, it is worth noting that the effect size appears to be modest. Specifically, a 100-point increase in roommate average prior GPA is associated with a 5-point increase in post-GPA (\(b\) = 0.050; see column (4) of Table 1). The effect is about 6% as large as the effect of a 100-point increase in prior GPA (\(b\) = 0.801), and it is about 10% of the average post-GPA. The magnitude is at a similar scale as reported by prior studies for various environments (e.g., dormitories and classrooms) and cultures (e.g., Western universities; see Supplementary Information Section 5.1 for details). To demonstrate its significance, we perform a falsification test by running the same OLS regression on the roommate null model, finding that the reported results are nontrivial (see Supplementary Information Section 5.3 for details). Together, these regression results suggest that a student’s performance is impacted not only by the average performance of roommates but also by their heterogeneity in academic performance.

### The effects of in-dorm ordinal rank

Dorm rooms provide a highly interpersonal yet local environment, where competitive dynamics between roommates may affect their academic performance. Conditional on absolute academic performance, the ordinal rank of a student in their dorm room could have an independent effect on future achievement^{80,81}. For instance, when a student’s ordinal rank is consistently low across all semesters, even if their absolute performance is high (e.g., the student has a GPA \(R\) = 0.9 and their roommates all have \(R\) > 0.9), they may still feel discouraged and less motivated, leading to fewer interactions with others and a potential decline in performance (see Supplementary Information Section 5.2 for explanations). This motivates us to study how a student’s in-dorm ordinal rank (OR_InDorm, with 1 being the highest and 4 being the lowest according to their prior performance; i.e., the number of better-achieving roommates including themself) affects their post-GPA. Specifically, we employ an OLS model that not only controls the student’s prior GPA, their roommate’s average prior GPA, and differences in prior GPAs, gender, and semester but also includes the fixed effects of cohort and major (see “Methods” for the empirical specification). We find that ordinal rank has a significantly positive effect on post-GPA (*P* value < 0.05; see columns (1) and (2) of Table 2 and Fig. 4a), suggesting that the number of better-achieving roommates in the dorm room predicts a student’s better academic performance in the future.

Through regression, we further examine whether the positive relationship between ordinal rank and post-GPA is moderated by other factors. We find that neither the interaction term of ordinal rank and own prior GPA nor the interaction term of ordinal rank and average roommate’s prior GPA is significant (*P* value > 0.1; see columns (3) and (4) of Table 2). Yet, the interaction term of ordinal rank and differences in roommate prior GPA (RM_Diff) is significantly negative (*P* value < 0.05; see columns (5) of Table 2). Specifically, the effect of ordinal rank on post-GPA is more pronounced (slope *b* = 0.007; 95% CI = [0.002, 0.012]) when RM_Diff is low (Fig. 4b), while the effect is not significant (slope *b* = \(-\)0.000; 95% CI = [\(-\)0.007, 0.007]) when RM_Diff is high (see Supplementary Information Section 5.2 for detailed results of a simple slope test). The result also shows that high post-GPA is associated with large differences in roommate prior GPA when ordinal rank is low (see the red line on the lower left of Fig. 4b). Although the effect size is modest, our falsification test on the roommate null model demonstrates that the results are nontrivial and significant (see Supplementary Information Section 5.3 for details). Taken together, these results suggest that roommate peer effects tend to disproportionately benefit underachieving students with homogeneous roommates (i.e., those who have similar performance) and high-achieving students with heterogeneous peers (i.e., those who have widely varied performance).

## Discussion

We quantified roommate peer effects on academic performance by applying both null-model and regression approaches to analyze a longitudinal dataset of student accommodation and academic performance, where roommate assignments are plausibly random upon enrollment and roommate relationships persist until graduation. We found evidence showing that roommates have a direct influence on a student’s performance, with some heterogeneity in the variation among the roommates and the baseline achievement of the student. Specifically, by constructing a roommate null model and calculating an assimilation metric, we showed that roommates have more similar performance than expected by chance alone. Moreover, the average assimilation of roommate academic performance exhibits an overall increasing trend over time, suggesting that peer effects become stronger as roommates live together longer, get more familiar with each other, and establish stronger interactions that facilitate knowledge spillovers^{61,65,82}. More specifically, the increase in assimilation is more pronounced in the third semester (Fig. 2b and Supplementary Fig. 8), which is consistent with previous literature showing that peer effects are strong and persistent when friendships last over a year^{79,83}, and it appears to be disrupted in the fifth semester, which may be because senior students have a higher chance of taking different elective courses and have more outside activities that might decrease the interactions between roommates^{84}.

Our regression analysis further unpacks roommate peer effects, especially along the dimension of peer heterogeneity. We found that a student’s future performance is not only strongly predicted by their prior performance, suggesting a significant path dependence in academic development^{85,86,87}, but also impacted by their roommates’ prior performance. Also, the positive relationship between a student’s future performance and the average prior performance of roommates is moderated by peer heterogeneity such that it is more pronounced when roommates are similar. In particular, when living with roommates who have, on average low prior performance, a student benefits more if roommates are more different, suggesting the positive role of peer heterogeneity^{88,89,90}. Moreover, ordinal rank in the dorm room has an independent effect since the number of better-achieving roommates is positively associated with future performance. Yet, peer heterogeneity moderates this relationship such that it is significant only when roommates are more similar. The magnitudes of peer effects assessed using regression may appear modest, but they are significant and in line with the literature. Together, these results paint a rich picture of roommate peer effects and suggest that the effective strategy for improving a student’s performance may depend on their position in a high-dimensional space of ordinal rank, peer average performance, and peer heterogeneity.

While our work helps better understand roommate peer effects, the results should be interpreted in light of the limitations of the data and analysis. First, the longitudinal data were limited to two cohorts of Chinese undergraduates in one university. The extent to which these findings can be generalized to other student populations, universities, and countries should be further investigated where relevant data on student accommodation and academic outcomes are available. Second, the roommate assignments were plausibly random according to the administrative procedures. While providing some supporting evidence for this assumption (see Supplementary Information Section 1.2 for details), we lacked comprehensive data on student demographics, personal information, and pre-college academic performance to examine it directly. Third, the analysis relies on GPA percentiles normalized for each cohort and major, which allows for fair comparisons between disciplines but, at the same time, may lose more information in the data. A better normalization that preserves the distribution of GPAs, for example, would be an improvement. Fourth, factors outside of the dormitory environment may mediate the assimilation of roommates’ academic performance, such as orderliness, classroom interactions, social networks, behavior patterns, and common external factors^{16,17,65}. Unraveling the mechanisms underlying roommate peer effects (e.g., peer pressure and student identity^{91}) was beyond the reach of this study but is desirable as future work.

In summary, we demonstrate the peer effect of college roommates and assess its magnitude by employing basic statistical methods to analyze new longitudinal data from a quasi-experiment. The university dorm room environment is ideal for identifying a group of frequently interacting and stable student peers whose learning outcomes can be easily tracked over time. The null model we use, which is essentially permutation tests^{75,76}, does not assume linear relationships between variables and is flexible enough to be applied to study peer effects in other complex social systems. Also, effect sizes assessed by the null model can facilitate comparisons between different datasets. Moreover, the regression model allows us to address concerns about inverse causality and better understand peer effects. Particularly, the regression findings have potential policy implications for education and dormitory management. For example, by adjusting the composition of roommates, such as reducing peer heterogeneity for students with, on average, high-achieving roommates, dorm rooms may be engineered, to some extent, to enhance the positive influence of roommates in improving students’ academic performance. Furthermore, our findings suggest the benefits of exposure to student role models and learning from peers in everyday life in addition to teachers in classrooms only.

## Methods

### Data

Chinese universities provide on-campus dormitories for almost all undergraduates, allowing us to observe a large-scale longitudinal sample of student roommates and relate it to their academic performance. From a public university in China, we collected the accommodation and academic performance data of 5,272 undergraduates, who lived in identical 4-person dorm rooms in the same or nearby dorm building on campus. Different from a dorm suite that contains four separate bedrooms, a 4-person dorm room is a single bedroom with four beds, where each student occupies one bed and shares public areas with roommates (see Supplementary Fig. 1 for an example layout). Per the university’s student accommodation management regulations, newly admitted students were assigned to dorm rooms under the condition that those in the same administrative unit, major, or school live together as much as possible and there is no gender mix in dorm rooms or buildings. The process neither allowed students to choose roommates or rooms nor took into account their academic performance before admission, socioeconomic backgrounds, or personal preferences. Students were informed of their accommodation only when they moved in before the first semester. As a quasi-experiment, the administrative procedure resulted in a plausibly, if not perfect, random assignment of roommates concerning their prior academic performance and personal information. Moreover, there was no significant individual selection later in the semesters. Once assigned together, roommates lived together until their graduation. Moving out or changing roommates was very rare on a few occasions (see Supplementary Information Section 1.2 for more details).

The dataset covers two cohorts of Chinese undergraduates who were admitted by the university in 2011 and 2012, respectively. For each student, we solicited information about their cohort, gender, major, and dorm room, based on which we determined roommate relationships. As a measure of academic performance, we collected the GPA data of these students for the first five successive semesters up to 2014 and further normalized it for each semester to a GPA percentile for students in the same cohort and major (see Supplementary Information Section 1.2 for details). The stable roommate relationship and the longitudinal academic performance data allowed us to study how a student is affected by roommates over time. All students were anonymized in the data collection and analysis process, and the dataset contains no identifiable information. This study was approved by the Institutional Review Board (IRB) at the University of Electronic Science and Technology of China (IRB No. 1061420210802005).

### Statistical hypothesis test

Given a tier of classification for students’ GPA, following permutation tests^{74,75,76}, we perform a statistical test to examine whether the relative ratio \({\mathbb{E}}\) of each combination (e.g., 1111) in the actual data deviates significantly from its theoretical value 0. Specifically, we generate a roommate null model by implementing the random shuffling process and calculate the null-model relative ratio for each combination: \(\widetilde{{\mathbb{E}}}=\left({P}_{n}-{P}_{t}\right)/{P}_{t}\), where \({P}_{n}\) and \({P}_{t}\) is the null-model and theoretical frequency of the combination, respectively. By null-model construction, \({P}_{n}\) should approach \({P}_{t}\), and thus \(\widetilde{{\mathbb{E}}}\) should be close to 0. For each combination, we compare the actual \({\mathbb{E}}\) with its null-model \(\widetilde{{\mathbb{E}}}\). If \({\mathbb{E}}\) is significantly above 0, the probability of observing \({\mathbb{E}}\le \widetilde{{\mathbb{E}}}\) in the actual data should be sufficiently small, e.g., less than 0.001. Accordingly, our null hypothesis (H0) is \({\mathbb{E}}\le \widetilde{{\mathbb{E}}}\), and the alternative hypothesis (H1) is \({\mathbb{E}} \, > \, \widetilde{{\mathbb{E}}}\). To empirically test H0, we generate 1000 roommate null models (where each null model is an independent implementation of the random shuffling process) and calculate \(\widetilde{{\mathbb{E}}}\) under 2-tier, 3-tier, and 4-tier classifications, respectively. We find that \({\mathbb{E}}\) of some combinations is larger than \(\widetilde{{\mathbb{E}}}\) for all 1000 roommate null models, allowing us to reject H0 and support H1 (i.e., \({\mathbb{E}}\) is significantly larger than 0 with a *P* value < 0.001 in the one-sided statistical test; the combination is over-represented in the actual data). Similarly, we test whether \({\mathbb{E}}\) of a combination is significantly below 0. Under the 2-tier classification, for example, combinations with significantly positive \({\mathbb{E}}\) include 1111 and 2222 (*P* value < 0.001) and those with significantly negative \({\mathbb{E}}\) include 1112 and 1122 (*P* value < 0.001) as well as 1222 (*P* value < 0.05; see Supplementary Table 2 for the statistical testing results for each combination under these tier classifications). Overall, we find that significantly positive combinations have the same or nearby tier numbers and significantly negative ones have distant tier numbers.

To perform a single statistical test for all combinations together given a tier of classification, we calculate the total relative ratio \(\sum \left|{\mathbb{E}}\right|\) and \(\sum \left|\widetilde{{\mathbb{E}}}\right|\) by summing up the absolute \({\mathbb{E}}\) and \(\widetilde{{\mathbb{E}}}\) of each combination, respectively. As \(\widetilde{{\mathbb{E}}}\) is close to 0, \(\sum \left|\widetilde{{\mathbb{E}}}\right|\) should also be close to 0. If we assume \(\sum \left|{\mathbb{E}}\right|\le \sum \left|\widetilde{{\mathbb{E}}}\right|\), it is naturally that \(\sum \left|{\mathbb{E}}\right|\) is close to 0, yielding \({\mathbb{E}}\) to be close to 0. There, \({\mathbb{E}}\) and \(\widetilde{{\mathbb{E}}}\) wouldn’t have a significant difference because they are both close to 0. Thereby, to say \({\mathbb{E}}\) is significantly different from \(\widetilde{{\mathbb{E}}}\), the probability of observing \(\sum \left|{\mathbb{E}}\right|\le \sum \left|\widetilde{{\mathbb{E}}}\right|\) should be sufficiently small, e.g., less than 0.001. Accordingly, our null hypothesis (H0) is \(\sum \left|{\mathbb{E}}\right|\le \sum \left|\widetilde{{\mathbb{E}}}\right|\), and the alternative hypothesis (H1) is \(\sum \left|{\mathbb{E}}\right| > \sum \left|\widetilde{{\mathbb{E}}}\right|\). We find that, under 2-tier, 3-tier, and 4-tier classifications, \(\sum \left|{\mathbb{E}}\right|\) is always larger than \(\sum \left|\widetilde{{\mathbb{E}}}\right|\) for all 1000 roommate null models, allowing us to reject H0 and support H1 with a *P* value < 0.001 (i.e., the overall \({\mathbb{E}}\) of all combinations is different from 0). Taken together, our hypothesis testing results suggest that \({\mathbb{E}}\) of some combinations in the actual data deviate significantly from 0, where those with nearby tier numbers are more likely to be observed and those with distant tier numbers are less likely to be observed than random chance, suggesting significant roommate peer effects (see Supplementary Information Section 3.2 for details).

### Regression model

We employ an ordinary least squares (OLS) model to study the relationship between a student’s future performance (GPA_Post) and the average prior performance of their roommate (RM_Avg) and how this relationship is moderated by the differences in roommate prior performance (RM_Diff). The OLS model includes several controls on student demographics and prior performance. Specifically, the empirical specification is given by

where \({\epsilon }_{i}\) is the error term for student *i*, and the semester index *s* ranges from 1 to 4. The dependent variable \({G}_{i}^{s+1}\) is the student’s GPA in semester *s* + 1 (GPA_Post), and the independent variable of interest \({G}_{i}^{s}\) is the student’s GPA in semester *s* (GPA_Prior). The variable \({{RA}}_{i}^{s}\) is the roommate average GPA in semester *s* (RM_Avg), \({{RD}}_{i}^{s}\) is the differences in roommate GPAs in semester *s* (RM_Diff), and \({{RA}}_{i}^{s}\times {{RD}}_{i}^{s}\) is their interaction term. The variable \({D}^{{Ge}}\) is a gender dummy, which is coded as 1 and 0 for females and males, respectively. The variables \({D}^{{Ma}}\), \({D}^{{Co}}\), and \({D}^{{Se}}\) are major, cohort, and semester dummies, respectively (see Supplementary Table 3 for details).

Moreover, we employ an OLS model to study the relationship between a student’s in-dorm ordinal rank (OR_InDorm) according to prior performance and their future performance after controlling their prior performance, the average and differences in roommate prior performance, their gender, major, cohort, and semester. Meanwhile, we examine how this relationship is moderated by other factors, including peer heterogeneity. Specifically, the empirical specification is given by

where \({{OR}}_{i}^{s}\) is the OR_InDorm of student \(i\) in semester \(s\) (ranging from 1 to 4) and \({\epsilon }_{i}\) is the error term. The interaction terms are \({{OR}}_{i}^{s}\times {G}_{i}^{s}\) between OR_InDorm and GPA_Prior, \({{OR}}_{i}^{s}\times {{RA}}_{i}^{s}\) between OR_InDorm and RM_Avg, and \({{OR}}_{i}^{s}\times {{RD}}_{i}^{s}\) between OR_InDorm and RM_Diff for student \(i\) in semester \(s\). All other controls are the same as above (see Supplementary Information Section 5 for details on these variables and Supplementary Table 3 for summary statistics).

### Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

## Data availability

All data necessary to replicate the statistical analyses and main figures are available in Supplementary Information and have been deposited in the open-access repository Figshare (https://doi.org/10.6084/m9.figshare.25286017)^{92}. The raw data of anonymized student accommodation and academic performance are protected by a data use agreement. Those who are interested in the raw data may contact the corresponding authors for access after obtaining Institutional Review Board (IRB) approval.

## Code availability

All code necessary to replicate the statistical analyses and main figures has been deposited in the open-access repository Figshare (https://doi.org/10.6084/m9.figshare.25286017)^{92}.

## References

Lewis, K., Gonzalez, M. & Kaufman, J. Social selection and peer influence in an online social network.

*Proc. Natl Acad. Sci. USA***109**, 68–72 (2012).Aral, S., Muchnik, L. & Sundararajan, A. Distinguishing influence-based contagion from homophily-driven diffusion in dynamic networks.

*Proc. Natl Acad. Sci. USA***106**, 21544–21549 (2009).Centola, D. The spread of behavior in an online social network experiment.

*Science***329**, 1194–1197 (2010).Muchnik, L., Aral, S. & Taylor, S. J. Social influence bias: a randomized experiment.

*Science***341**, 647–651 (2013).Wolske, K. S., Gillingham, K. T. & Schultz, P. Peer influence on household energy behaviours.

*Nat. Energy***5**, 202–212 (2020).Falk, A. & Ichino, A. Clean evidence on peer effects.

*J. Labor Econ.***24**, 39–57 (2006).Banerjee, A., Chandrasekhar, A. G., Duflo, E. & Jackson, M. O. The diffusion of microfinance.

*Science***341**, 1236498 (2013).Contractor, N. S. & DeChurch, L. A. Integrating social networks and human social motives to achieve social influence at scale.

*Proc. Natl Acad. Sci. USA***111**, 13650–13657 (2014).Aral, S. & Nicolaides, C. Exercise contagion in a global social network.

*Nat. Commun.***8**, 14753 (2017).Quispe-Torreblanca, E. G. & Stewart, N. Causal peer effects in police misconduct.

*Nat. Hum. Behav.***3**, 797–807 (2019).Bramoull. Peer effects in networks: A survey.

*Annual Review of Economics***12**, 603–629 (2020).Zimmerman, D. J. Peer effects in academic outcomes: evidence from a natural experiment.

*Rev. Econ. Stat.***85**, 9–23 (2003).Imberman, S. A., Kugler, A. D. & Sacerdote, B. I. Katrina’s children: evidence on the structure of peer effects from hurricane evacuees.

*Am. Economic Rev.***102**, 2048–2082 (2012).Feld, J. & Zlitz, U. Understanding peer effects: on the nature, estimation, and channels of peer effects.

*J. Labor Econ.***35**, 387–428 (2017).Golsteyn, B. H. H., Non, A. & Zlitz, U. The impact of peer personality on academic achievement.

*J. Political Econ.***129**, 1052–1099 (2021).Cao, Y. et al. Orderliness predicts academic performance: behavioural analysis on campus lifestyle.

*J. R. Soc. Interface***15**, 20180210 (2018).Yao, H., Lian, D., Cao, Y., Wu, Y. & Zhou, T. Predicting academic performance for college students: a campus behavior perspective.

*ACM Trans. Intell. Syst. Technol.***10**, 24 (2019).Sacerdote, B. Peer effects in education: how might they work, how big are they and how much do we know thus far?

*Handb. Econ. Educ.***3**, 249–277 (2011).Lewbel, A., Qu, X. & Tang, X. Social networks with unobserved links.

*J. Political Econ.***131**, 898–946 (2023).Ha, W. Quasi-experimental evidence of academic peer effects at an Elite University in People’s Republic of China.

*Asia Pac. Educ. Rev.***17**, 703–718 (2016).Ma, L. & Huang, Y. Roommate effects on students’ performance in higher education.

*Peking. Univ. Educ. Rev.***19**, 41–63 (2021).Gao, J., Zhang, Y. C. & Zhou, T. Computational socioeconomics.

*Phys. Rep.***817**, 1–104 (2019).Hoxby, C. M. Peer effects in the classroom: learning from gender and race variation. National Bureau of Economic Research. NBER Working Paper No. w7867 https://doi.org/10.3386/w7867 (2000).

Carman, K. G. & Zhang, L. Classroom peer effects and academic achievement: evidence from a Chinese middle school.

*China Economic Rev.***23**, 223–237 (2012).Lavy, V., Paserman, M. D. & Schlosser, A. Inside the black box of ability peer effects: evidence from variation in the proportion of low achievers in the classroom.

*Economic J.***122**, 208–237 (2012).Burke, M. A. & Sass, T. R. Classroom peer effects and student achievement.

*J. Labor Econ.***31**, 51–82 (2013).Carrell, S. E., Fullerton, R. L. & West, J. E. Does your cohort matter? measuring peer effects in college achievement.

*J. Labor Econ.***27**, 439–464 (2009).Lavy, V. & Schlosser, A. Mechanisms and impacts of gender peer effects at school.

*Am. Economic J.: Appl. Econ.***3**, 1–33 (2011).Padilla-Walker, L. M. & Bean, R. A. Negative and positive peer influence: relations to positive and negative behaviors for African American, European American, and Hispanic adolescents.

*J. Adolescence***32**, 323–337 (2009).Brady, R. R., Insler, M. A. & Rahman, A. S. Bad company: understanding negative peer effects in college achievement.

*Eur. Economic Rev.***98**, 144–168 (2017).Eckles, D., Kizilcec, R. F. & Bakshy, E. Estimating peer effects in networks with peer encouragement designs.

*Proc. Natl Acad. Sci. USA***113**, 7316–7322 (2016).Booij, A. S., Leuven, E. & Oosterbeek, H. Ability peer effects in university: evidence from a randomized experiment.

*Rev. Economic Stud.***84**, 547–578 (2017).Christakis, N. A. & Fowler, J. H. The collective dynamics of smoking in a large social network.

*N. Engl. J. Med.***358**, 2249–2258 (2008).Sotoudeh, R., Harris, K. M. & Conley, D. Effects of the peer metagenomic environment on smoking behavior.

*Proc. Natl Acad. Sci. USA***116**, 16302–16307 (2019).Kawaguchi, D. Peer effects on substance use among American teenagers.

*J. Popul. Econ.***17**, 351–367 (2004).Duncan, G. J., Boisjoly, J., Kremer, M., Levy, D. M. & Eccles, J. Peer effects in drug use and sex among college students.

*J. Abnorm. Child Psychol.***33**, 375–385 (2005).Borsari, B. & Carey, K. B. Peer influences on college drinking: a review of the research.

*J. Subst. Abus.***13**, 391–424 (2001).Kremer, M. & Levy, D. Peer effects and alcohol use among college students.

*J. Economic Perspect.***22**, 189–206 (2008).Han, Y., Grogan-Kaylor, A., Delva, J. & Xie, Y. Estimating the heterogeneous relationship between peer drinking and youth alcohol consumption in Chile using propensity score stratification.

*Int. J. Environ. Res. Public Health***11**, 11879–11897 (2014).Strother, L., Piston, S., Golberstein, E., Gollust, S. E. & Eisenberg, D. College roommates have a modest but significant influence on each other’s political ideology.

*Proc. Natl Acad. Sci. USA***118**, e2015514117 (2021).Xie, Y., Fang, M. & Shauman, K. STEM education.

*Annu. Rev. Sociol.***41**, 331–357 (2015).Dennehy, T. C. & Dasgupta, N. Female peer mentors early in college increase women’s positive academic experiences and retention in engineering.

*Proc. Natl Acad. Sci. USA***114**, 5964–5969 (2017).Wu, D. J., Thiem, K. C. & Dasgupta, N. Female peer mentors early in college have lasting positive impacts on female engineering students that persist beyond graduation.

*Nat. Commun.***13**, 6837 (2022).Bostwick, V. K. & Weinberg, B. A. Nevertheless she persisted? gender peer effects in doctoral STEM programs.

*J. Labor Econ.***40**, 397–436 (2022).Thiemann, P. The persistent effects of short-term peer groups on performance: evidence from a natural experiment in higher education.

*Manag. Sci.***68**, 1131–1148 (2022).Jones, T. R. & Kofoed, M. S. Do peers influence occupational preferences? evidence from randomly-assigned peer groups at West Point.

*J. Public Econ.***184**, 104154 (2020).Herbst, D. & Mas, A. Peer effects on worker output in the laboratory generalize to the field.

*Science***350**, 545–549 (2015).Anelli, M. & Peri, G. The effects of high school peers’ gender on college major, college performance and income.

*Economic J.***129**, 553–602 (2019).Hasan, S. & Koning, R. Prior ties and the limits of peer effects on startup team performance.

*Strategic Manag. J.***40**, 1394–1416 (2019).Chetty, R. et al. How does your kindergarten classroom affect your earnings? evidence from Project STAR.

*Q. J. Econ.***126**, 1593–1660 (2011).Cornelissen, T., Dustmann, C. & Schnberg, U. Peer effects in the workplace.

*Am. Economic Rev.***107**, 425–456 (2017).Carrell, S. E., Hoekstra, M. & Kuka, E. The long-run effects of disruptive peers.

*Am. Economic Rev.***108**, 3377–3415 (2018).Cheng, S., Brand, J. E., Zhou, X., Xie, Y. & Hout, M. Heterogeneous returns to college over the life course.

*Sci. Adv.***7**, eabg7641 (2021).DeLay, D. et al. Peer influence on academic performance: a social network analysis of social-emotional intervention effects.

*Prev. Sci.***17**, 903–913 (2016).Li, Z. A., Wang, G. & Wang, H. Peer effects in competitive environments: field experiments on information provision and interventions.

*Manag. Inf. Syst. Q.***45**, 163–191 (2021).Kiessling, L., Radbruch, J. & Schaube, S. Self-selection of peers and performance.

*Manag. Sci.***68**, 8184–8201 (2022).Currarini, S., Jackson, M. O. & Pin, P. Identifying the roles of race-based choice and chance in high school friendship network formation.

*Proc. Natl Acad. Sci. USA***107**, 4857–4861 (2010).Mercken, L., Steglich, C., Sinclair, P., Holliday, J. & Moore, L. A longitudinal social network analysis of peer influence, peer selection, and smoking behavior among adolescents in British schools.

*Health Psychol.***31**, 450 (2012).Jackson, M. O., Nei, S. M., Snowberg, E. & Yariv, L. The dynamics of networks and homophily. National Bureau of Economic Research, NBER Working Paper No. w30815 https://doi.org/10.3386/w30815 (2023).

Sacerdote, B. Peer effects with random assignment: results for Dartmouth roommates.

*Q. J. Econ.***116**, 681–704 (2001).Zhang, L. & Pu, S. It takes two shining lights to brighten the room: peer effects with random roommate assignments.

*Educ. Econ.***25**, 3–21 (2017).Chen, Y. & Snmez, T. Improving efficiency of on-campus housing: an experimental study.

*Am. Economic Rev.***92**, 1669–1686 (2002).Pu, S., Yan, Y. & Zhang, L. Peers, study effort, and academic performance in college education: evidence from randomly assigned roommates in a flipped classroom.

*Res. High. Educ.***61**, 248–269 (2020).Eckles, D. & Bakshy, E. Bias and high-dimensional adjustment in observational studies of peer effects.

*J. Am. Stat. Assoc.***116**, 507–517 (2021).Stadtfeld, C., Vrs, A., Elmer, T., Boda, Z. & Raabe, I. J. Integration in emerging social networks explains academic failure and success.

*Proc. Natl Acad. Sci. USA***116**, 792–797 (2019).Whitmore, D. Resource and peer impacts on girls’ academic achievement: evidence from a randomized experiment.

*Am. Economic Rev.***95**, 199–203 (2005).Duflo, E., Dupas, P. & Kremer, M. Peer effects, teacher incentives, and the impact of tracking: evidence from a randomized evaluation in Kenya.

*Am. Economic Rev.***101**, 1739–1774 (2011).Lomi, A., Snijders, T. A., Steglich, C. E. & Torlo, V. J. Why are some more peer than others? evidence from a longitudinal study of social networks and individual academic performance.

*Soc. Sci. Res.***40**, 1506–1520 (2011).Sacerdote, B. Experimental and quasi-experimental analysis of peer effects: two steps forward?

*Annu. Rev. Econ.***6**, 253–272 (2014).Raudenbush, S. W. & Schwartz, D. Randomized experiments in education, with implications for multilevel causal inference.

*Annu. Rev. Stat. Its Application***7**, 177–208 (2020).Mucha, P. J., Richardson, T., Macon, K., Porter, M. A. & Onnela, J.-P. Community structure in time-dependent, multiscale, and multiplex networks.

*Science***328**, 876–878 (2010).Cimini, G. et al. The statistical physics of real-world networks.

*Nat. Rev. Phys.***1**, 58–71 (2019).Váša, F. & Mišić, B. Null models in network neuroscience.

*Nat. Rev. Neurosci.***23**, 493–504 (2022).Krackhardt, D. Predicting with networks: nonparametric multiple regression analysis of dyadic data.

*Soc. Netw.***10**, 359–381 (1988).Hubert, L. & Schultz, J. Quadratic assignment as a general data analysis strategy.

*Br. J. Math. Stat. Psychol.***29**, 190–241 (1976).Raudenbush, S. W. & Bryk, A. S.

*Hierarchical Linear Models: Applications and Data Analysis Methods*. Vol. 1 (Sage Publications, 2002).Boda, Z., Elmer, T., Vörös, A. & Stadtfeld, C. Short-term and long-term effects of a social network intervention on friendships among university students.

*Sci. Rep.***10**, 2889 (2020).Angrist, J. D. The perils of peer effects.

*Labour Econ.***30**, 98–108 (2014).Patacchini, E., Rainone, E. & Zenou, Y. Heterogeneous peer effects in education.

*J. Economic Behav. Organ.***134**, 190–227 (2017).Murphy, R. & Weinhardt, F. Top of the class: the importance of ordinal rank.

*Rev. Economic Stud.***87**, 2777–2826 (2020).Bertoni, M. & Nisticò, R. Ordinal rank and the structure of ability peer effects.

*J. Public Econ*.**217**, 104797 (2023).Webb, N. M. Student interaction and learning in small groups.

*Rev. Educ. Res.***52**, 421–445 (1982).Foster, G. It’s not your peers, and it’s not your friends: some progress toward understanding the educational peer effect mechanism.

*J. Public Econ.***90**, 1455–1475 (2006).Deslauriers, L., McCarty, L. S., Miller, K., Callaghan, K. & Kestin, G. Measuring actual learning versus feeling of learning in response to being actively engaged in the classroom.

*Proc. Natl Acad. Sci. USA***116**, 19251–19257 (2019).Erikson, R., Goldthorpe, J. H., Jackson, M., Yaish, M. & Cox, D. R. On class differentials in educational attainment.

*Proc. Natl Acad. Sci. USA***102**, 9730–9733 (2005).Petersen, A. M., Jung, W.-S., Yang, J.-S. & Stanley, H. E. Quantitative and empirical demonstration of the Matthew effect in a study of career longevity.

*Proc. Natl Acad. Sci. USA***108**, 18–23 (2011).Miao, L. et al. The latent structure of global scientific development.

*Nat. Hum. Behav.***6**, 1206–1217 (2022).Hamilton, B. H., Nickerson, J. A. & Owan, H. Team incentives and worker heterogeneity: an empirical analysis of the impact of teams on productivity and participation.

*J. Political Econ.***111**, 465–497 (2003).Lyle, D. S. The effects of peer group heterogeneity on the production of human capital at West Point.

*Am. Economic J.: Appl. Econ.***1**, 69–84 (2009).Chan, T. Y., Li, J. & Pierce, L. Compensation and peer effects in competing sales teams.

*Manag. Sci.***60**, 1965–1984 (2014).Akerlof, G. A. & Kranton, R. E. Identity and schooling: some lessons for the economics of education.

*J. Economic Lit.***40**, 1167–1201 (2002).Cao, Y., Zhou, T. & Gao, J. Heterogeneous peer effects of college roommates on academic performance. Figshare. https://doi.org/10.6084/m9.figshare.25286017 (2024).

## Acknowledgements

The authors thank Min Nie, Shimin Cai, Defu Lian, Zhihai Rong, Huaxiu Yao, Yifan Wu, Lili Miao, and Linyan Zhang for their valuable discussions. This work was partially supported by the National Natural Science Foundation of China Grant Nos. 42361144718 and 11975071 (T.Z.) and the Ministry of Education of Humanities and Social Science Project Grant No. 21JZD055 (T.Z.).

## Author information

### Authors and Affiliations

### Contributions

T.Z. and J.G. designed research; T.Z. collected data; Y.C. and J.G. performed research; Y.C., T.Z., and J.G. analyzed data; J.G. wrote the paper; Y.C. and T.Z. revised the paper.

### Corresponding authors

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Peer review

### Peer review information

*Nature Communications* thanks the anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available.

## Additional information

**Publisher’s note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Supplementary information

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Cao, Y., Zhou, T. & Gao, J. Heterogeneous peer effects of college roommates on academic performance.
*Nat Commun* **15**, 4785 (2024). https://doi.org/10.1038/s41467-024-49228-7

Received:

Accepted:

Published:

DOI: https://doi.org/10.1038/s41467-024-49228-7

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.