1 Introduction

One of Sociology’s founding ideas is that a society’s socio-cultural population homogeneity is no prerequisite for social integration. Modern mass-scale societies, according to Durkheim’s (2014 [1893]) famous claim, are based on organic solidarity that derives from people’s mutual dependency on each other, which again is a result of the complex division of labor in these societies. Other classics, such as Simmel (1950 [1908]) or Parsons (1971), reaffirmed this claim in own nuances. When asked what consequences continued immigration and corresponding increases in ethnic diversity have for the social integration of mass-scale societies, one prominent answer is thus: None, because their social integration is produced organically through mutual dependencies (Portes and Vickstrom 2011).Footnote 1

Yet, a growing body of empirical work, which takes Putnam’s (2007) canonical study as a point of departure, questions this answer. That is, social science research shows various indicators of social integration—reflecting all four ingredients of social integration outlined in the introduction to this special issue (Grunow et al., this issue)—to score systematically lower in countries, cities, or neighborhoods that are composed of more ethnically diverse populations (for Germany see for example, Gundelach and Traunmüller 2014; Koopmans and Veit 2014; Schaeffer 2014). Although these studies and their results are contested (again for Germany see for example, Petermann and Schönwälder 2012; Stolle et al. 2013), a recent meta-analysis, which focuses on survey questions about social trust as an indicator of social integration, confirms the reliability of the overall pattern: Across 87 studies from around the world, levels of social trust are systematically lower among residents of ethnically diverse settings (Dinesen et al. 2020).

What is less clear and reliably understood, however, is why immigration limits social integration in mass-scale societies. Reviews of the explanations that have been proposed so far may be summarized as suggesting two types of explanations (Dinesen et al. 2020; Koopmans et al. 2015; van der Meer and Tolsma 2014; Schaeffer 2014, Ch. 3). The first type of explanation focuses on overall anomie or social disorganization stemming from a lack of shared goals, communication problems, or sparse social contacts among residents in ethnically diverse settings. The second type focuses on conflicts between members of different ethnic groups as mitigating social integration in ethnically diverse settings. These conflict-based explanations dominate the debate and focus especially on mainstream majority membersFootnote 2, because these are regarded as having a collective interest in maintaining their dominant position in society.

In this article, we aim to further probe the conflict approach and focus on mainstream majority members and their exposure to immigrants in their direct neighborhood. We take inspiration from recent work on crime and voting for right-wing populist parties that has identified two specific types of residential segregation between mainstream majority members and immigrant minorities as particularly contentious or conflict-prone spatial manifestations of ethnic diversity (broadly understood). First, the contested boundaries hypothesis claims that neighborhoods sandwiched between ethnically defined neighborhoods are particularly conflict prone (Legewie and Schaeffer 2016) and have higher crime rates (Dean et al. 2019; Legewie 2018a). Their location between differently populated communities, according to the theoretical argument, makes these sandwiched neighborhoods particularly susceptible to conflicts over community territory (i.e., the contested question to which of the two competing ethnic enclaves the sandwiched borderland belongs). Second, the halo-effect hypothesis proposes that mainstream majority members are more likely to vote for right-wing populist parties when they live in homogenous neighborhoods that border on ethnically diverse ones or are even encircled by them (Bowyer 2008; Martig and Bernauer 2018; Valdez 2014)—the idea of the encircled neighborhood gives the halo effect its name. Here, the argument is that such halo constellations entail limited opportunities for personal inter-group contact experiences in people’s direct neighborhoods, whereas the presence of immigrants on the fringes of their neighborhoods instills feelings of group threat and hostility.

This article investigates whether ethnic residential boundaries and halos also predict reduced levels of social integration, as indicated by the classic survey questions about social trust (Bauer and Freitag 2018) as well as two measures of community attachment. We thus investigate the co-orientation dimension of social integration (i.e., ingredients one and two) as conceptualized in the introduction to this special issue (Grunow et al., this issue). Our article thereby directly follows one of Dinesen et al.’s (2020) suggestions to push the field forward by investigating the role of complex spatial manifestations of immigration and, more specifically, makes three contributions. First, we extend existing theory by elaborating on why social integration may be regarded as suffering from these two spatial manifestations of immigration. Second, we give a descriptive overview of the extent to which ethnic residential boundaries and halo constellations characterize German cities and rural regions. Third, we provide the first empirical test of these ideas based on the geo-coded German General Social Survey (ALLBUS/GGSS) 2016 and 2018 that we merge with small-scale 100-m × 100‑m spatial grid data from the German Census 2011.

2 Theoretical Background

An arguably stylized summary of the evolution of the immigration and social integration debate may be given as follows: In the 1990s, economists started to pay growing attention to the question whether ethnic diversity may be partly accountable for slow rates of economic growth in (particularly African) low income countries—as best exemplified by Easterly and Levine’s (1997) seminal study. In the 2000s, they widened their focus and started to investigate whether ethnic diversity, or the lack thereof, may also account for why some (particularly European) states have strong solidarity-based welfare states, high levels of trust in strangers, and a rich civic associational life—whereas others do not (Alesina et al. 2001; Alesina and La Ferrara 2000, 2002). The theoretical argument these studies proposed is that ethnic divisions result in parochialism (i.e., solidarity narrowed to members of one’s ethnic group) and conflicts over resources and political dominance—that is, the dark side of social integration (Grunow et al., this issue). In 2007 political scientist Robert D. Putnam (2007) shifted the attention away from divisions between domestic ethnic groups (e.g., Flames and Walloons in Belgium) to immigration, thereby increasing the relevance of the debate to North American and European pundits and policymakers.

Since Putnam, hundreds of studies have investigated the potentially negative link between immigration and social integration (for systematic reviews see Dinesen et al. 2020; van der Meer and Tolsma 2014; Schaeffer 2014, Ch. 2). These studies are fueled by the fact that two well-established theories are typically regarded as resulting in contradicting predictions concerning the consequences of immigration-induced ethnic diversity for social integration. On the one hand, the parochialism and sub-group conflicts associated with ethnic diversity undermine trust in strangers because in ethnically diverse settings, strangers have various ethnic backgrounds (Dinesen and Sønderskov 2015). Immigration is thus seen as challenging the social integration of modern mass-scale societies since many interactions and exchanges that constitute these societies are necessarily between strangers (Grunow et al., this issue; Sønderskov 2011). But based on contact theory (Pettigrew 1998), and arguably Putnam’s (2000) earlier work on the integrating function of contacts that bridge between different social groups (i.e., bridging social capital), some scholars alternatively suggest that increased exposure to members of different ethnicity should strengthen overall social integration. Such exposure, according to the argument, increases the opportunity to make positive personal contact experiences (Laurence and Bentley 2018; Schlueter and Scheepers 2010), which enhance solidarity and empathy for difference and thereby countervail parochialism and help people to trust strangers. Hence, contact versus conflict is the dominant theoretical theme of the debate.Footnote 3

In this article we explain why the antithesis between conflict and contact theory may be regarded as artificially puffed up and can be resolved from a meso-sociological perspective (Klinger et al. 2017; Traunmüller 2013). Allport—a founding figure of Psychology—had already noted that not just any contact but specifically “equal status contact between majority and minority groups in the pursuit of common goals” (Allport 1954, p. 281) helps to overcome prejudice and establish empathy and mutual understanding. By contrast, he described superficial exposure to result in conflict and thus increased prejudice and racism (Allport 1954, p. 251). As Traunmüller (2013) noted, the important sociological question implied in Allport’s theory is which societal conditions further the probability that citizens make positive equal status contact experiences in the pursuit of common goals, or rather are superficially exposed to immigrants—maybe even in the pursuit of opposing or competing goals.

Traunmüller’s (2013) and Ziller’s (2014) country-comparative work identifies two conditions that tip the balance towards superficial and thus contentious contact: If ethnic diversity overlaps with further dimensions of difference (e.g., socio-economic differences) and when it takes the form of polarization (e.g., two equally sized groups opposing each other, see also Dincer 2011). However, for methodological reasons, this line of work cannot easily be extended to comparing cities or neighborhoods within countries (Schaeffer 2013). This is unfortunate because the association between ethnic diversity and social integration is particularly pronounced at these small contextual levels (Dinesen et al. 2020; Dinesen and Sønderskov 2015).

To fill this gap, we draw inspiration from research on crime and right-wing populist voting to identify two types of ethnic residential segregation that are particularly likely to erode social integration by instilling conflict, while limiting positive personal contact experiences: Ethnic residential boundaries and halos. Both are meso-sociological constellations that strongly tip the balance towards superficial contact and—worse—the pursuit of competing goals. Below we introduce these two spatial manifestations of immigration in more detail. We then explain why this contentiousness should erode social integration and finally add a novel hypothesis according to which social integration should be lower at ethnic residential boundaries and halos within cities but should also generally undermine social cohesion in cities and regions characterized by having many such boundaries and halos.

2.1 Conflict and Contact at Contested Boundaries and Halo Constellations

Legewie and Schaeffer (2016) devise the contested boundaries hypothesis, according to which ethnically diverse areas sandwiched between ethnically defined neighborhoods are particularly contentious. They motivate this hypothesis by arguing that at such locations, two refined mechanisms proposed by subbranches of parochialism and conflict theory jointly produce tensions beyond those generally found in ethnically diverse neighborhoods. First, the defended neighborhoods mechanism suggests that residents of the ethnically defined (i.e., homogenous) areas might develop exclusive community identities (i.e., amalgamating a place-based neighborhood identity with their ethnic identity)—the dark side of social integration (Grunow et al., this issue). Such exclusive community identities heighten residents’ motivation to defend their neighborhood’s ethnic integrity (Campbell et al. 2009). Second, Gould (2003) explains that polarized situations, where two equally sized opponents face each other, are particularly contentious because the ambiguity about which of the two groups eventually obtains social and political dominance breeds additional tension (i.e., in contrast to situations where a dominant majority and a minority fight over resources). The sandwiched location between two homogenous ethnic enclaves should activate both mechanisms and thereby instill a heightened conflict over the social and political dominance in the sandwiched borderland. In sum, at ethnic residential boundaries members of different ethnic groups come into regular contact with one another in their everyday neighborhood, but as competitors and not as equals in the pursuit of common goals. Legewie and Schaeffer (2016) further argued that these claims should hold particularly for poorly defined fuzzy borderland areas because well-defined sharp boundaries leave little room for ambiguity and thus conflict. However, this sub-aspect of the argument has recently been put into question (Goplerud 2022). Ethnic residential boundaries may be identified with edge detection or areal wobbling techniques, both of which are types of spatial analyses (Legewie 2018b; Lu and Carlin 2005). Note that we can unfortunately only investigate the importance of contested boundaries for the mainstream majority population, and only under the assumption that foreign nationals may be regarded as a somewhat coherent outgroup by those mainstream majority members (see Sect. 3 for further details). In favor of their hypothesis, Legewie and Schaeffer (2016) demonstrate that complaints about neighbors are more frequent at ethnic residential boundaries, and further studies provide evidence for increased crime rates at such locations (Dean et al. 2019; Legewie 2018a).

The halo-effect hypothesis makes a related, albeit somewhat different, claim (Bowyer 2008; Rydgren and Ruth 2013). According to this idea, it is mainstream majority members of homogenous neighborhoods that border, or in extreme cases, are even encircled by (Lim et al. 2007) neighborhoods dominated by immigrants who feel particularly threatened for their groups’ dominant status in the community. Thus, where the contested boundaries hypothesis locates the climax of tensions within the sandwiched and ethnically diverse borderland, the halo-effect hypothesis locates it within homogenous neighborhoods close to the border of another ethnic enclave. The idea is that residents of homogenous neighborhoods have limited opportunities to make positive personal contact experiences with immigrants, so that all the conflict mechanisms discussed above may operate unchecked and thus in full force. That is, residents may develop fears that the bordering outgroup members threaten their neighborhood’s ethnic integrity and their group’s dominant position. Ethnic residential halos are typically measured as the ratio or difference in minority shares between a focal direct and the surrounding bordering neighborhoods, but fine-grained geospatial data allow for more versatile operationalizations (Jünger and Schaeffer 2020). The halo-effect hypothesis has received widespread empirical support in research on right-wing populist voting among native European voters, that is, electoral support for political parties that mobilize on anti-immigrant parochialism and fears that the dominant position of the native majority is under threat. The hypothesis successfully explains such voting in the UK (Biggs and Knauss 2011; Bowyer 2008), France (Evans and Ivaldi 2020), the Netherlands (van Wijk et al. 2020), Sweden (Rydgren and Ruth 2013; Valdez 2014), Switzerland (Martig and Bernauer 2016, 2018), anti-immigrant policymaking in the USA (Andrews and Seguin 2015), and parochial in-group cooperation in across African countries (Schaub 2017). However, it does not account for xenophobic and racist attitudes in Germany (Jünger and Schaeffer 2020; Klinger et al. 2017), or trust that a lost wallet would be returned in the Netherlands (Tolsma and van der Meer 2017).

2.2 Social Integration at Contested Boundaries and Halo Constellations

So far, we have established why contested boundaries and halo constellations may plausibly be regarded as particularly contentious types of ethnic residential segregation that have indeed been proven to result in parochialism and conflicts over resources and political dominance. However, we still need to elaborate on why they are also likely to disintegrate social life to make a truly convincing case that we properly test conflict-driven ethnic diversity effects on social integration. Our elaboration is based on a theoretical argument and a discussion of the survey items we analyze.

First and most importantly, the introductory chapter to this special issue emphasizes that trust, solidarity, and cooperation between societal sub-groups constitutes an important aspect of a society’s overall social integration (Grunow et al., this issue). This aspect constitutes exactly the opposite of ethnic competition and conflict over neighborhood spaces. Thus, although contested boundaries and halos may imply high levels of social integration among co-ethnics, this form of social integration is what we have termed parochial social integration above. It is a form of intense sub-group social integration that compromises wider societal social integration as it erodes bonds between mainstream and minority members. In the introductory chapter, parochial social integration was also called the dark side of social integration (Grunow et al., ths issue). Here, this dark side is located at the sub-level of ethnic groups, especially exclusive nationalism among mainstream members, and potentially comes at the expense of overall social integration between all members of a municipality.

This argument is also reflected in the survey items that we use in this analysis (see Sect. 3), all of which are indicators of social integration typically used in social science research. The questions ask whether most people can be trusted and whether respondents feel attached to their municipality or Germany and all its residents. Contested boundaries and halos may certainly instill strong parochial group solidarity that makes respondents trust and feel strongly attached to some residents, but at the same time should result in mistrust and little to no attachment regarding others. This assumption implies that contested boundaries and halos will make it difficult for people to choose the highest answer categories according to which most people can be trusted and according to which they feel strongly attached to their municipality and Germany with all their residents. Based on this, we formulate the following two hypotheses:

H 1

The more an area forms the sandwiched boundary between a mainstream and an immigrant neighborhood, the lower are levels of social trust as well as municipality and national attachment among its mainstream residents.

H 2

The more an area resembles an ethnic residential halo, the lower levels of social trust as well as municipality and national attachment among its mainstream residents.

2.3 Social Integration in Spatially Fragmented Cities

Ethnic residential boundaries and halos locate conflict and tension at specific geospatial locations within cities and regions. However, based on similar arguments—limited positive contact coupled with overtly superficial exposure—another sub-line in the immigration debate demonstrates that overall city- or regional-level ethnic diversity is specifically eroding or disintegrating if coupled with stronger sub-city/regional ethnic residential segregation (Laurence et al. 2019; Schaeffer 2014, Ch. 7). This argument follows the same logic as the above claim that some social conditions may further social integration within sub-groups (i.e., here segregated ethnically homogenous neighborhoods) but compromise social integration on a higher societal level (i.e., here on the municipal and national level). We thus further hypothesize:

H 3

The more ethnic residential boundaries and halos define a municipality’s residential landscape, the lower levels of social trust as well as municipality and national attachment among its mainstream residents.

3 Data and Methods

We assess our three hypotheses based on two data sources, which we join by the geo-locations of their observations. All steps of our analyses can be reproduced by using our RMarkdown replication file, which is part of an openly accessible (and currently anonymous) Open Science Framework (OSF) repository: https://osf.io/mx3hv/?view_only=71588e43d8424b40adead0a337f018e0.

The RMarkdown file also contains supplementary analyses and results that may be of interest. The OSF repository further contains three pre-registrations of this study, that is, time-stamped drafts of the theory, hypotheses, methodological design, and plan of analysis that we had written before we carried out the final analysis. We pre-registered our empirical test before we carried it out, so that our theorizing and empirical design—including changes demanded by reviewers and editors—are not influenced by the actual results.

The first data source we use is survey data from the georeferenced German General Social Survey 2016 and 2018 (i.e., “Allgemeine Bevölkerungsumfrage Sozialwissenschaften,” ALLBUS/GGSS). The GGSS is a bi-annual cross-sectional survey of German-speaking persons who are at least 18 years of age and live in a private household in Germany (GESIS Leibniz-Institut Für Sozialwissenschaften 2019). Further information about the GGSS can be found in the accompanying detailed technical reports.Footnote 4 For this article, we analyze the sample of 5680 respondents who are German citizens and whose parents were born in Germany (or in one of the former German eastern provinces, such as Silesia or East Prussia). The contextual demographic data we have is not well suited to studying respondents of immigrant origin (i.e., who are immigrants or whose parents have immigrated to Germany, see below). There is a second reason to focus on native majority members. In theory, diversity effects apply to immigrants and their descendants just as they apply to mainstream majority populations. But in practice, results frequently differ, mostly because greater diversity often indicates more exposure to co-ethnics for immigrants and their descendants but the opposite of mainstream majority members (Koopmans and Schaeffer 2015). We thus focus on mainstream members in this analysis—also because it was only after the final affirmation of our pre-registration by the reviewers that we could identify a sample of up to 1287 respondents of immigrant origin.

Because respondents’ address locations of the GGSS 2016 and 2018 are georeferenced, we can locate them in a map of Germany that is composed of 100-m × 100‑m (1 ha) quadratic grids, for which the German Census 2011 provides demographic data (Statistisches Bundesamt 2020), our second data source.Footnote 5 We can thus locate respondents in very fine-grained contextual units compared with earlier research on context effects in Germany, but variably enlarge those units (e.g., to 200-m × 200‑m grids) to better capture their lived environment. What is more, we can go beyond standard (multilevel) contextual research and measure the demographic composition of people’s focal environment (the grid they live in) and the demographic composition of bordering and more distanced grids. This approach allows us to identify ethnic residential boundaries and halos, and to thereby live up to recent calls to push (multilevel) contextual research beyond the “aspatial” treatment of neighborhoods as isolated areas (Hipp and Williams 2020). To the best of our knowledge, our two earlier articles on halo effects on xenophobia and racism are the only studies on Germany following this call (Jünger and Schaeffer 2020; Klinger et al. 2017).

This advantage of using the Census 2011 comes at a considerable cost: a 5- and 7‑year gap between our predictors and the outcome, during which Germany saw one of its largest influxes of refugees. Unfortunately, Germany’s Census 2011 was the first in 30 years, and none has been conducted since then. Thus, more recent figures on spatial shares of immigrants can only be obtained on the level of whole cities and regions (i.e., where all of Berlin or Hamburg are one unit each that we could compare). This makes ethnic residential boundary and halo analyses virtually impossible. A second shortfall of using the otherwise high-quality demographic data provided by the Census 2011 is that the only information on the ethnic composition of grids is the share of non-German citizens. This is problematic for three reasons. First, the theory section emphasized polarized spatial situations arising from two homogenous ethnic enclaves being situated next to each other. However, the share of non-German nationals is uninformative about whether the non-German citizens are a single nationally homogenous group or a multi-national assembly of people from various backgrounds. Thus, the multiple comparisons possible in a US context—where a contested boundary may be between a white and Asian neighborhood or between a Hispanic and a Black one—do not apply to our analysis. Second, the focus on non-German nationals overlooks German citizens of immigrant origin (i.e., who are immigrants or whose parents immigrated to Germany). Third, we cannot focus on populations that are likely regarded as phenotypically distinct in the German context (e.g., Germany’s Black population). The latter two points are less concerning than they might seem at first sight because the share of foreign nationals is a reliable proxy of the average perceived share of persons of immigrant origin (r = 0.94, p < 0.001, Schaeffer 2014). The first point is more problematic, however, and means that we can sensibly conduct this analysis only for the mainstream majority population, and only under the assumption that foreign nationals may be regarded as a somewhat coherent outgroup by those mainstream majority members—despite the multi-national differences among foreign nationals. With these data, a presumably homogenous focal grid with 100% foreign nationals is likely not homogeneous from the point of view of a person of immigrant origin; for a mainstream majority member, a homogenous focal grid with 100% German citizens is indeed very homogenous.

3.1 Dependent Variables

Social integration is a complex and arguably multi-dimensional phenomenon, which is thus difficult to measure. Here, we focus on four simple but robust indicators of social integration that capture the first two ingredients of social integration (Grunow et al., this issue) with two survey questions each. The four survey questions were posed to all respondents of the GGSS 2016 and 2018.

We capture the first ingredient of social integration with two questions on attachment to fellow members of society: On a scale ranging from “very strongly,” “pretty strongly,” “not strongly” to “not at all” (as well as “don’t know”) respondents were asked to answer “Now we would like to know how strongly you identify with your town (community)Footnote 6 and its inhabitants” followed by “And what about Germany as a whole and its population?” As elaborated above, both questions seem suitable because they refer to the overall population of respondents’ municipality and Germany, thus indicating higher-level social integration that may suffer from parochial social integration. We z‑standardize both variables and treat them as continuous.

Further, we capture the second ingredient of social integration with two questions on social trust. The first is one of the oldest and best-established measures of social integration (Bauer and Freitag 2018), the generalized trust question: “Some people think that most people can be trusted. Others think that one can’t be careful enough when dealing with other people. What do you think?” They were given the answer categories “Most people can be trusted,” “One can’t be careful enough,” “It depends,” “Other, please enter,” and “Don’t know.” Following standard practice, we recode answers into a binary variable with 1 indicating “Most people can be trusted” and 0 indicating any of the other answers (apart from the 0.12% “Don’t know” answers, which we treat as missing values). In addition to the generalized trust, we also use another survey question that seems particularly well suited to test whether contested boundaries and halos compromise trust: “Is there any area in the IMMEDIATE vicinity—I mean within a kilometer or so—where you would prefer not to walk alone at night?” with the simple answer categories “Yes, there is,” “No there isn’t,” and “Don’t know.”

3.2 Predictor 1: Ethnic Residential Boundaries

Here, we briefly describe the operationalization of ethnic residential boundaries and halos so that readers may conceptually understand the numerical measures used in the regression analyses that test our three hypotheses. More detailed and technical explanations can be found in Legewie (2018b), Jünger and Schaeffer (2020), and by studying our RMarkdown replication file.

To operationalize ethnic residential boundaries, we follow Legewie and Schaeffer (2016) and use edge detection techniques—a set of methods originally developed for image processing. The general goal of this method is to detect sudden changes of color in raster images, which effectively results in the identification of color boundaries between different areas of an image. For example, if we had a simple image of a kitchen table, edge detection can be used to identify the contours of the table’s legs and its tabletop, thereby separating it from its surroundings. Social scientists can use edge detection techniques by replacing color values with demographic information (in our case, the share of immigrants in each grid cell), allowing them to detect residential boundaries separating different social groups. In summary, we apply edge detection to identify changes in the share of immigrant residents. Areas characterized by such change are the sandwiched border regions between mainstream neighborhoods and so-called immigrant enclaves.

Some developments allow the application of edge detection techniques to irregularly shaped geometries, such as administrative neighborhoods or census tracks (Legewie 2018b). Yet, a better alternative for such data might be areal wombling (Lu and Carlin 2005; Womble 1951), which is why it is more popular and better established than edge detection in geography and related social science fields. However, edge detection is particularly well suited to raster data, such as the 1‑ha grid cells provided by the Census 2011. For this reason, we rely on classic edge algorithms.

It is important to note that there are different types of edge detection techniques. Depending on the specific algorithm used and the corresponding image filters, identified contours or boundaries can be more or less sharp and intense. To determine the most appropriate algorithm for our purposes without breaching the requirements of a pre-registered study, we proceed in the following way that left the GGSS 2016 and 2018 survey data and the dependent variable it contains untouched. We generate a random sample of 3136 geo-locations across Germany’s territory, which are meant to represent potential survey participants for which we need to identify edge values. Based on these data, we then fine-tune our edge-detection algorithm, resulting in the following decisions.

First, the number of immigrants in a grid cell correlates with the pure existence of settlement areas, which would lead the edge-detection algorithm to draw boundaries between areas where people live and areas where no one lives. However, we aim to detect sudden changes in the ethnic composition of neighborhoods. Therefore, we filter grid cells with ≥25% of non-German nationals and post-process the resulting map by a kernel density estimator (i.e., the smoothed share of non-German residents per grid). As Fig. 1a displays this for the city of Cologne, the resulting spatial map data represents a nuanced picture of ethnic residential diversity, including individual hotspots in the northeast, where it is particularly high. Second, we then use an edge-detection algorithm that relies on a simple Sobel image filter. A Sobel image filter is a 3 × 3 matrix with numerical values in its nine cells that, if applied to a focal grid cell and its directly surrounding eight grid cells, identifies whether the focal grid cell is one at which the population composition (i.e., percentage of non-German residents) changes from left to right or from top to bottom. The resulting edge value identifies whether a grid is sandwiched between a mainstream neighborhood and an immigrant enclave and expresses this as a number ranging from 0—indicating no change in the percentage of non-German residents (e.g., within a mainstream neighborhood, or within an ethnically diverse neighborhood)—to the extreme case of 1, which would indicate that the percentage of non-German residents changes abruptly from 0% non-German residents to 100%. We apply a Sobel image filter that produces somewhat unsharp boundaries that fade out across grids. We do so because the 1‑ha-sized grids are arguably smaller than the lived and experienced everyday life neighborhoods of their residents. The result is displayed in Fig. 1b. In line with the above explanation, the dark areas in Fig. 1b are not characterized by many non-German residents (thus contrasting Fig. 1a), but rather by a sharp change (from left to right or top to bottom) in the 5 non-German residents; the darker areas are the sandwiched areas between mainstream and immigrant neighborhoods and thus identify the locations at which we expect conflict and disintegration.

Fig. 1
figure 1

Ethnic residential boundaries and halos in Cologne, Germany. Kernel density of immigrants (a), edge intensity derived from kernel density (b), and 250 m vs. 500 m and 250 m vs. 1000 m halo constellations (c)

Our algorithm produces an edge distribution that is, unsurprisingly, extremely right skewed, with most grids having values close to 0 and very few grids with substantially higher grid values. This result is largely a function of rural–urban differences because there are no ethnic residential boundaries in rural areas—an important descriptive insight in itself. Therefore, in a set of sub-analyses, we will focus on residents of large cities (i.e., with more than 100,000 inhabitants).

3.3 Predictor 2: Ethnic Residential Halos

Concerning ethnic residential halos, the conceptual idea is that people live in a homogenous focal neighborhood (i.e., the neighborhood they are residents of) encircled by surrounding neighborhoods composed of members of different ethnic backgrounds. We conduct the following four steps to operationalize this idea into a numeric variable. First, we define a respondent’s focal neighborhood as a circular ego-hood with a radius of 250 m that has the centroid of the 100 m × 100 m spatial grid in which the respondent lives in its center (Bivand et al. 2008; Jünger 2019). Thus, our focal neighborhoods are individually centered around each person and may thus differ from person to person (Petrović et al. 2019). In a related fashion, we next define the surrounding neighborhoods as a somewhat larger ego-hood (with radii of either 500 or 1000 m, resulting in two operationalizations) with the focal neighborhood in its center cut out, resulting in a donut-shaped ring. Figure 1c displays our operationalization. It shows a fictional respondent’s residence as a black dot in its center. This respondent’s focal neighborhood is the yellow circular ego-hood in which the black dot is located. This focal neighborhood is surrounded by a purple-colored and donut-shaped surrounding-neighborhoods ring, which has variably a 500- or a 1000‑m radius.

Third, we respectively sum the number of German and foreign nationals living in all 100-m ×100-m grids falling into the focal and surrounding neighborhoods to calculate the percentage of foreign nationals. We treat grids without data as non-residential areas where no one lives—thereby, we avoid estimating kernel densities. Fourth and finally, we calculate a numeric halo score by following the approach of Andrews and Seguin (2015). That is, we take the ratio between the share of foreign nationals of the surrounding neighborhoods and divide it by the share of foreign nationals in the focal neighborhood: \(\text{Halo}=\frac{{\%}\text{Foreign nationals}_{\text{Surrounding neighborhoods}}+0.1}{{\%}\text{Foreign nationals}_{\text{Focal neighborhood}}+0.1}\). Because some focal neighborhoods have 0% foreign nationals, but a division by 0 is mathematically not defined, we add 0.1% to the percentage of foreign nationals of all focal and surrounding neighborhoods. One may wonder whether focal and their respective surrounding neighborhoods should not be defined with smaller or larger radii and whether this differs for urban compared with rural settings. Following Jünger and Schaeffer (2020), our RMarkdown replication files, therefore, contain results for 14 different operationalizations overall, based on 100-, 250-, 500-, and 1000‑m focal neighborhoods and fitting surrounding neighborhood rings. Moreover, these additional results are presented separately for urban and rural settings.

3.4 Predictor 3: Contentious Ethnic Residential Segregation

Last, we aggregate edges and halos to the level of municipalities to test hypothesis H 3 about the degree to which a municipality is characterized by contentious segregation. For this purpose, we calculate the median values of each municipality’s ethnic residential edges and halos (of 250 m vs. 500 m and 250 m vs. 1000 m). The median is an appropriate choice given that the measures are very rightly skewed and therefore sensitive to outliers. We also z‑standardize these median values across municipalities and generate an overall additive scale (i.e., average z‑standardized median combining edges and halos). We join individual and these aggregated municipality data with respondents’ municipality of residence.

3.5 Control Variables

Following established research on contextual ethnic diversity effects, we consider a range of socio-demographic variables on both the individual and the contextual community level as control variables to adjust for confounding as far as this is possible. On the individual level, as provided by the GGSS, we control for gender, age (in years), education (“low”: International Standard Classification of Education [ISCED] 1–2, “lower-medium”: ISCED 3, “upper-medium”: ISCED 4–5, and “high”: ISCED 6–8), unemployment (according to the International Labor Organization definition), whether the respondents rent or own their place of living, East/West German differences, as well as their interaction with the survey year to control for heterogenous time trends (Auspurg et al. 2019), and a classification of the degree of the community’s urbanity (more than 100,000 residents, 20,000 to 100,000 residents, 5000 to 20,000 residents, and less than 5000 residents). We furthermore use information provided by the German Census 2011 to control for the percentage of foreign nationals and the number of residents on the level of the focal neighborhood (i.e., population density, given the equal sizes of grids),Footnote 7 and for the categorized average apartment size on the 1000-m × 1000‑m grid level as a proxy of socio-economic deprivation. Our openly accessible RMarkdown replication file reports a table with descriptive statistics for all variables used in this study.

3.6 Missing Values

Overall, 12.25% of the respondents have a missing value on either the dependent- or one of the individual-level control variables from the GGSS. With 8.45%, the average apartment size is the control variable with the largest share of missing values. There are no missing values for the contextual predictor variables. Supplementary results of our RMarkdown replication file show no systematic association between our three predictors and whether generalized trust is missing. Following van Buuren (2012), we replace missing values with 13 imputations, which equals the percentage of cases with at least one missing value. We obtain imputations using chained equations and predictive mean imputation. As widely recommended, our imputation models contain the full set of individual- and contextual-level variables introduced above, including the dependent variable. Yet, because it is controversial whether imputed values for the dependent variable should be considered in the final analysis, our RMarkdown replication file contains supplementary results that exclude these values.

3.7 Modeling

To test our three hypotheses, we estimate the strength of the linear association between our above-defined predictor variables and our four indicators of social integration using linear regression with cluster-robust standard errors on the municipality level. For the two binary outcomes, we estimate linear probability models, which have several advantages over generalized linear models when the sole purpose lies in hypothesis testing rather than prediction (Breen et al. 2018). By using cluster-robust standard errors, we deal both with heteroskedasticity resulting from analyzing a binary outcome and account for the multilevel structure of our data, including the fact that some of our predictors and controls are contextual variables; note that adjusting errors at the highest level of clustering (i.e., here the municipality) accounts for all within-cluster heterogeneity and sub-cluster-driven correlation (Cameron and Miller 2015; Heisig et al. 2017). We refrain from estimating spatial regression models because these types of models are aimed at adjusting for spatial autocorrelation. However, the existence of such spatial autocorrelation in levels of generalized trust would speak against both the contested boundary (H 1) and the halo-effect hypothesis (H 2) because these argue that discontinuities in the socio-spatial structure of cities and regions have important consequences. That is, social integration should be significantly lower within ethnic residential boundaries and halos compared with other neighborhoods close by. By adjusting for spatial autocorrelation, we would thus unfairly stack the cards in favor of the hypotheses.

All models contain the full set of above-mentioned individual and contextual level control variables. Our RMarkdown replication file also contains bivariate results as well as results based on models that only adjust for individual-level controls. In the article, we furthermore present the results of models that contain only one of our predictors (i.e., either ethnic residential edge, halo, or one of the aggregated measures). Our RMarkdown replication file also contains results that consider these measures simultaneously in various combinations.

4 Results

We begin our analysis with a descriptive overview of the spatial distribution of ethnic residential boundaries and our two halo measures across German municipalities. Figure 2 comprises both maps and boxplots of their distribution. The first insight from this descriptive overview is that although the concepts of ethnic residential boundaries and halos are conceptually very related, their geographical distribution across Germany is not. Specifically, it seems that residential boundaries can mainly be found in large cities. For example, in Germany’s five largest cities—Berlin, Hamburg, Munich, Cologne, and Frankfurt—we find particularly high edge values indicating ethnic residential boundaries. Outside of large cities, they basically do not exist. This means that ethnic residential boundaries are a phenomenon that is very unevenly dispersed across German municipalities. It also means that ethnic residential boundaries are, with few exceptions, a phenomenon of the West. Except for Berlin, Leipzig, and Dresden, there are hardly any municipalities with notable ethnic residential boundaries in eastern Germany.

Fig. 2
figure 2

Ethnic residential boundaries and halos across German municipalities

For ethnic residential halos, by contrast, the picture is less extreme. Although halos are much more frequent in urban areas and in western Germany, they also occur in non-metropolitan municipalities of eastern and western Germany alike. This also means that they are generally more evenly dispersed across Germany and occur rather frequently. Nevertheless, these descriptive findings motivate us to also test our hypotheses in urban settings exclusively (see below) because it is in urban contexts where both ethnic residential boundaries and halos are prevalent.

Are levels of social integration, as indicated by social attachment and social trust, systematically lower at ethnic residential boundaries or in ethnic halo constellations? To answer this question, we link our spatial data to 5680 geo-located survey participants of the GGSS 2016 and 2018 and regress their stated levels of social trust and community attachment on our indicators of their residential ethnic segregation. These regressions adjust for a range of control variables, most importantly the neighborhood share of immigrants. We thereby assure that any association does not measure the mere exposure of mainstream members to persons of immigrant origin, but precisely the spatial constellations we are interested in. Table 1 displays overall 16 regression coefficients, each separately estimated to prevent problems of multicollinearity (Tab. F in the Online Appendix shows results, which are similar in conclusion, from models where all explanatory variables are considered at once). Figure 3 gives a more comprehensive overview of the same results expressed as standardized regression coefficients.

Table 1 Unstandardized regression coefficients for all four dependent variables and all four predictors
Fig. 3
figure 3

Standardized regression coefficients for all four dependent variables and all four predictors including 95% confidence intervals

The results in Tab. 1 and Fig. 3 largely contradict our three hypotheses. Only a single estimate (i.e., Alone at Night in Contentious Municipalities) is statistically significant at the 5% level. It does indeed suggest that inhabitants of municipalities with many ethnic residential halos and boundaries might be less trusting at night, that is, more concerned about areas in their neighborhood that they would prefer to avoid at night. That said, all other estimates are insignificant and small; in fact close to zero. This becomes especially obvious if we compare them against the estimated importance of education, the arguably best-established predictor of social integration. Although the difference between less and highly educated respondents is about 20 to 50% of a standard deviation (see Tab. B2, C2, and D2 in the Online Appendix), the 16 estimates shown in Fig. 3 imply less than 5% changes in social integration for a standard deviation increase in ethnic residential boundaries, halos, or contentious municipalities (except for the one statistically significant estimate and its similarly meager effect size of 6.5%). In turn, this also means that the estimates are not insignificant because of large standard errors. Quite to the contrary, the estimates are precisely estimated with small standard errors, but the effect sizes are small and very close to zero.

In the previous analysis, we assessed the relationship for all survey respondents across all of Germany—regardless of whether they live in urban or non-urban areas. However, because ethnic residential halos and boundaries are largely an urban phenomenon, Fig. A in the Online Appendix reports results for the subgroup of respondents living in municipalities with at least 100,000 inhabitants. We again find mostly estimates that are insignificant and close to zero. Some are statistically significant, but their overall pattern is random. Specifically, we now see more concerns about areas one should avoid at night among residents of ethnic residential boundaries (i.e., respondents who live in areas that are sandwiched between neighborhoods homogenously populated by mainstream members and immigrant minorities respectively) and less community attachment in municipalities with many such boundaries and halos. But at the same time, the results also suggest more generalized trust among residents at ethnic residential boundaries. Thus, the two estimates that seem to confirm the hypotheses are counterbalanced by one that directly counters it and 13 further insignificant ones. In short, zooming in on urban centers does not change the general insight that presumably contentious forms of ethnic residential segregation are not systematically linked to reduced levels of social integration. This insight also holds if we operationalize ethnic residential halos in various other scales, as is displayed in Fig. B in the Online Appendix. The figure reports tests for six other ethnic halo constellations operationalized at different sizes. Hypotheses tests are not designed to prove the null of no association. But taking all this together, we have convincing evidence that, at least in Germany, there is no systematic association between reduced levels of social integration and living at an ethnic residential boundary, in an ethnic halo constellation, or municipality with many of these types of ethnic residential segregation. If ethnic diversity erodes social cohesion, it is likely via mechanisms other than inter-ethnic group conflict.

This picture only changes if we look at the bivariate associations between social integration and our measures of presumably contentious constellations of ethnic diversity (Fig. C in the Online Appendix). Or if we consider the same association only adjusted for characteristics of the individual respondents but not for contextual factors such as population density, average flat size, or the neighborhood share of immigrants (Fig. D in the Online Appendix). If we do so, we see a consistent pattern of more concerns about areas than respondents would prefer to avoid at night but higher levels of generalized social trust for all three of our predictors: ethnic residential boundaries, halos, and their density in a municipality. The two attachment measures, identification with the municipality and Germany, continue to show no link. We suggest that these findings might allow for two interpretations. First, they can be spurious because the associations are not adjusted for population density and other factors that are linked to residents’ sense of safety and trust. In other words, a first interpretation favors our main findings over the bivariate and less adjusted ones because the latter are more prone to omitted variable bias. Second, these findings could indicate that mainstream members who are generally more trusting move selectively into—or remain living in—areas that others avoid because of their proximity to immigrant neighborhoods. Despite their generally greater trust in other people, these mainstream members are nevertheless aware of certain parts of their immediate environment that it is better to avoid at night. This interpretation assumes that the main results are over-controlled, for example, because of the adjustment for the share of immigrants in the neighborhood or potential post-treatment mediating variables. Unfortunately, our observational and cross-sectional analysis cannot differentiate between these two interpretations.

5 Conclusion

This article opened with the question of why immigration may erode the social integration of contemporary mass-scale societies. The dominant line of argumentation suggests that immigration and the implied increased ethnic diversity lead to competition and conflict between ethnic groups. These inter-group tensions undermine overall social integration. We put this dominant line of argumentation to the test by focusing on types of ethnic residential segregation that should be especially contentious. At ethnic residential boundaries, the ambiguity about which group dominates may breed conflict. Residents of ethnic residential halos are exposed to out-group members but may have little opportunity to get familiar with members of the other groups in personal encounters. Both types of ethnic segregation thus entail a strong potential for conflict and little opportunity for positive personal contact experiences. If ethnic diversity results in inter-group conflicts and tensions, it should do so at such locations.

Counter to these arguments, our spatial analysis of the GGSS 2016 and 2018 hardly provides evidence for the hypotheses that levels of social integration are reduced at these presumably most contentious types of ethnic segregation. Only when we do not statistically adjust for other contextual characteristics, such as population density or the neighborhood share of immigrants, do our results suggest a pattern that could indicate a clear interpretation: Ethnic residential boundaries, halos, and municipalities with many of these constellations are selectively inhabited by mainstream members that generally trust other people more. But at night, they are nevertheless more concerned about areas they prefer to avoid than are residents of neighborhoods with a less contentious ethnic composition. Identification with one’s municipality and Germany at large show no such link. This interpretation, however, is based on the strong assumption that one should not statistically adjust for the potentially confounding influence of other contextual characteristics. If one does take alternative contextual drivers of trust and fear at night into account, there is no systematic association between any of our measures of social integration and potentially contentious ethnic residential segregation.

Our spatial analysis has several limitations. Importantly, we do not have fine-grained population shares of different ethnic minorities but only the population shares of foreign nationals. Moreover, our analyses rely on fixed sizes of halos and ethnic residential boundaries. But one might argue that both constellations are larger in less densely populated areas, so their empirical operationalization should depend on population density. Although future research should surely improve these limitations, our analyses reveal effect sizes that are consistently close to zero and statistically insignificant and thus suggest that such improvements might not change the central insight provided here: At least in Germany, with its comparatively modest levels of ethnic residential segregation, social integration is not significantly eroded at ethnic residential boundaries or ethnic halos—if we compare areas that are otherwise similarly urban, socio-economically prosperous, and ethnically diverse. The most important and challenging limitation, in our regard, is our investigation’s observational and cross-sectional nature. Only a sound field experimental study could decide which of our two interpretations (see above) holds.

All of this does not mean, of course, that policymakers and urban planners should risk levels of ethnic residential segregation as found in US, French, or Swedish cities—simply because patterns of residential segregation are intractable once established. Regarding our opening question, researchers and policymakers are furthermore well advised to give more thought to other types of explanations that are currently marginal in the debate. Originating in arguments put forward by the Chicago School of Urban Sociology (Sampson and Groves 1989; Shaw and McKay 1942), immigration can lead to a lack of shared goals, increased communication problems, or sparse social contacts among residents in ethnically diverse settings. These arguments about ethnic diversity and resulting anomie and social disorganization imply no inter-group conflicts and competition.