year after their separation, we compare the characteristics of the old and the new job. We find that the death-induced decline in the non-white share of the old peer group leads non-white workers to move to new jobs that feature again a higher non-white share than the old jobs. Overall, these results are consistent with the idea that homophilic preferences for working with more same-race peers drive the initial separations of non-white workers.

Heterogeneity analyses reveal that the retention effects vary widely across different job types and peer group characteristics. We find larger effects in white-collar occupations than in bluecollar occupations, supporting the notion that the demand for workplace amenities – in our case, the preference to work with same-race peers – increases with income (Hamermesh, 1999; Pierce, 2001). Moreover, the effects are less pronounced in occupations requiring more teamwork, consistent with the contact hypothesis that predicts lower racial biases when group members frequently interact (Allport, 1954). In line with this, we also find that the impacts are smaller among incumbent workers who have a longer tenure in the firm alongside the deceased worker and thus had more opportunities to form a closer relationship with the deceased worker. In addition, the negative retention effects for non-white incumbents appear to be smaller in peer groups with a lower initial share of non-white workers. In these peer groups, non-whites have more contact with white coworkers which may reduce their in-group bias in coworker preferences.<sup>3</sup> We also compare the effects of having same-race or same-gender coworkers. Changes in the gender peer group composition, resulting from the death of a female – as opposed to a male – coworker, are not found to affect the retention of female and male incumbents. However, we find important interactions: non-white women, i.e. the most disadvantaged group in the labor market, are most strongly affected by their peer group composition. Specifically, the retention of non-white females decreases when losing a same-race _or_ same-gender coworker but is unaffected when losing a coworker that has the same race _and_ the same gender. These results highlight that unbundling asymmetries across diverse race and gender categories is important to draw a comprehensive picture of coworker interactions at work.

Our analysis speaks to several strands of literature. First, we contribute to the literature on peer effects at the workplace. While economic studies have focused on the impact of peer skills and productivity (Cornelissen _et al._ , 2017; Herbst and Mas, 2015; Mas and Moretti, 2009; Messina _et al._ , 2023), interdisciplinary research has also examined the impact of the demographic composition of peers (for surveys, see Joshi _et al._ (2011) and Williams and O’Reilly III (1998)). The latter studies mainly use data from single (or a small number of) firms in high-income

> 3This result is also consistent with models of labor market sorting based on amenity preferences (Rosen, 1986): Non-white workers who have the weakest preferences for working with similar peers may sort into jobs with fewer non-white coworkers and also react less strongly to an unexpected decline in the proportion of same-race coworkers.

3