1. Introduction
In both the United States and Europe, immigration has long dominated political agendas, with hostility toward immigrants and xenophobic attitudes intensifying over the past decades. Further, anti-immigrant rhetoric and policies have become increasingly mainstream in advanced economies, reshaping political landscapes and contributing to heightened polarization (Campo et al. Reference Campo, Giunti and Mendola2024; Ford & Jennings Reference Ford and Jennings2020; Golder Reference Golder2016; Grande et al. Reference Grande, Schwarzbözl and Fatke2019; Hainmueller & Hopkins Reference Hainmueller and Hopkins2014; Stockemer et al. Reference Stockemer, Niemann, Unger and Speyer2020). Understanding how immigration attitudes form and persist over the life cycle is central to explaining political responses to immigration. Yet, their determinants remain contested across different fields of social science.
Attitudes toward immigration can be understood as relatively stable cultural orientations that reflect beliefs about social boundaries, identity, and redistribution (Lancaster Reference Lancaster2020; O’Rourke & Sinnott Reference O’Rourke and Sinnott2006). As such, they are shaped by processes of cultural transmission and socialization unfolding over the life course. A large body of work in political psychology and cultural economics argues that political attitudes crystallize during the “impressionable years” of adolescence and early adulthood and remain relatively stable thereafter (Cotofan et al. Reference Cotofan, Dur and Meier2024; Krosnick & Alwin Reference Krosnick and Alwin1989; Kuhn et al. Reference Kuhn, Lancee and Sarrasin2021). Other studies, focusing on intergenerational transmission, emphasize the role of parental influence and early-life environments in shaping long-run preferences and values (Bisin & Verdier Reference Bisin and Verdier2001; Doepke & Zilibotti Reference Doepke and Zilibotti2017; Sapiro Reference Sapiro2004). Early-life environments may therefore play a central role in the formation of enduring political preferences through processes of horizontal social transmission (e.g., Berggren et al. Reference Berggren, Bergh and Nilsson2026; Laaker Reference Laaker2024). In particular, exposure to ethnic diversity during these formative years may leave a lasting imprint on individuals’ attitudes toward immigration.
From a theoretical perspective, early exposure to immigration may shape attitudes through several mechanisms, including perceived group threat, intergroup contact, and political socialization. These processes may also interact with gender and family background, as individuals interpret experiences with ethnic diversity through different cultural norms, social roles, and household environments.
In this paper, we examine whether exposure to immigrants during late adolescence has a persistent effect on attitudes toward immigration later in life. While previous studies have examined the relationship between immigration flows and stocks and public opinion, most focus on contemporaneous immigration levels or aggregate shocks, yielding mixed results (Dinesen et al. Reference Dinesen, Schaeffer and Sønderskov2020; sherman_does_2017). Put differently, most studies tend to ask whether and to what extent immigrant communities or sudden inflows of immigrants tend to shape opinions on immigration.Footnote 1 Much less is known about whether the timing of exposure matters, specifically whether local exposure to immigrants during the formative years has lasting consequences for political attitudes.Footnote 2 Our hypothesis is that, beyond questions of inflows, stock composition, size, or pace, the timing of exposure to such inflows or stocks over individuals’ lives is likely to shape their attitudes toward immigration.
To address this question, we combine individual-level panel data from the German Socio-Economic Panel (SOEP) with administrative information on the share of migrants at granular geographical levels (Kreisen or county level). The longitudinal nature of the SOEP data, covering the period 1999–2022, allows us to track the development of individual attitudes over two decades, addressing a critical gap in the literature, which has so far been dominated by cross-sectional studies (Dinesen et al. Reference Dinesen, Schaeffer and Sønderskov2020; Dražanová et al. Reference Dražanová, Gonnot, Heidland and Krüger2024). We link individuals’ attitudes toward immigration observed in adulthood to the demographic environment in which they lived at age 18. Our identification strategy exploits within-county variation in migrant shares across birth cohorts while controlling for cohort, survey-year, and county fixed effects. This approach allows us to compare individuals who grew up in the same location but were exposed to different levels of immigration during their formative years.
Germany provides a unique context for this study, as it experienced large variations in immigration inflows across regions and cohorts during the period we study. In the early 1990s, in the midst of the reunification efforts, Germany experienced its second-highest post-war influx of migrants, followed by a phase of low immigration and even net emigration in the 2000s, and then a sharp reversal and a substantial influx of immigrants in the 2010s. This temporal variation generates meaningful differences in immigration exposure across cohorts and locations, which we exploit to study how early exposure shapes long-run attitudes. Using this variation, we construct a dataset linking individuals’ immigration attitudes to the share of migrants in the county where they lived at age 18. Focusing on respondents who turned 18 between 1995 and 2018, we combine self-reported attitudes toward immigration with complete residential histories and county-level migrant shares. Our final sample includes 5,127 individuals observed about five times each, yielding 27,727 observations.
Migrant exposure at age 18 varies significantly across Germany, with higher shares in former West Germany and major cities. In the aggregate, attitudes toward immigration fluctuate over time: around 65% express some worry, with peaks during the 2016 refugee crisis and increased openness during the 2020–21 pandemic. At the individual level, although many interviewees maintain stable views, 35–40% change their attitudes between survey waves. The dataset also reveals a young sample, balanced by gender, with mostly German citizens and varied educational backgrounds.
Our findings show that exposure to immigration during late adolescence has a persistent effect on attitudes toward immigration in adulthood. In our preferred specification, a one percentage point increase in the migrant share in an individual’s county at age 18 increases the probability of expressing concern about immigration by roughly 1.5 percentage points. Importantly, this effect appears to be specific to the formative period: analogous measures of immigration exposure later in life are small and statistically insignificant. The results remain robust when controlling for contemporaneous migrant shares and local economic conditions. We also explore whether the effect varies across population groups. The evidence suggests that the influence of early exposure operates relatively uniformly across gender and education levels. While individuals with higher education tend to express more favorable attitudes toward immigration overall, the effect of early immigration exposure does not differ systematically across educational groups or between men and women. These findings are in line with the idea that early exposure shapes general political attitudes rather than reflecting gender- or skill-specific economic concerns. In fact, we find evidence of heterogeneity across spatial environments, with the effect of early exposure being primarily driven by individuals raised in urban areas. We interpret this as suggestive evidence that in less densely populated and less diverse settings such as rural areas, perceived group threat may be attenuated by more direct and repeated intergroup contact. Taken together, our findings indicate that the local environments individuals experience during adolescence can shape political attitudes long after those experiences occur. Exposure to demographic change during the impressionable years may therefore have lasting consequences for the evolution of public opinion on immigration.
This paper contributes to the literature in three main ways. First, it highlights the importance of the timing of exposure to immigration, showing that local migrant presence during the formative years has lasting consequences for immigration attitudes. Second, it provides evidence based on highly granular local exposure measures matched to individuals’ residential histories, allowing us to study the effects of demographic change at the scale where social interactions occur. Third, by exploiting long-run panel data on individuals’ attitudes, the paper contributes to debates on the stability and formation of political preferences over the life cycle. Together, these contributions highlight that exposure during the formative years constitutes a distinct channel through which local demographic conditions translate into persistent individual attitudes.
The rest of the paper is organized as follows. Section 2 reviews the background literature. Section 3 describes the data and sample selection. Section 4 presents the empirical framework and identification strategy, while Section 5 reports the results. Section 6 concludes.
2. Background literature
In recent decades, a vast literature has examined the determinants of immigration attitudes, their dynamics, and how individual opinions form (and change) over the life course. Contributions in political science argue that changes in attitudes and behaviors are shaped by three distinct factors: “period effects,” which refer to events that influence everyone at a specific point in time; “cohort effects,” linked to the generation in which individuals were born; and individual factors such as “ageing” and education.
Starting from the latter, the process of aging is widely believed to correlate with a hardening of attitudes toward immigration (for an overview, see Hainmueller & Hopkins (Reference Hainmueller and Hopkins2014); for recent studies, see Jeannet (Reference Jeannet2018); Dražanová et al. (Reference Dražanová, Gonnot, Heidland and Krüger2024)). As people age, their attitudes may become more resistant to change, potentially leading to more conservative views on issues like immigration. Indeed, this trend is in line with empirical findings on political attitudes more broadly (O’Grady Reference O’Grady2019a; O’Grady Reference O’Grady2019b; O’Grady & Abou-Chadi Reference O’Grady and Abou-Chadi2019; Peterson et al. Reference Peterson, Smith and Hibbing2020; Tilley & Evans Reference Tilley and Evans2014). Numerous empirical studies include age as a standard demographic control variable and show a statistically significant relationship with attitudes toward immigration, although the magnitude of this relationship varies considerably (Dražanová Reference Dražanová2022; McLaren & Paterson Reference McLaren and Paterson2019).
In contrast to analyses of aging and political attitudes, a recent strand in the literature emphasizes the relative stability of attitudes over time (Jeannet & Dražanová Reference Jeannet and Dražanová2019; Kustov et al. Reference Kustov, Laaker and Reller2021; Lancaster Reference Lancaster2020). Thanks to the accumulation of panel surveys, scholars are increasingly able to track the evolution of political attitudes and distinguish them from more volatile issue salience (Dennison & Geddes Reference Dennison and Geddes2019).Footnote 3
The flip side of this observed stability is the existence of a period during which individuals are particularly susceptible to shaping their opinions, attitudes, and behaviors. However, there is little consensus on terminology or precise age boundaries for this period. Terms such as political socialization (Sapiro Reference Sapiro2004), impressionable years (Peterson et al. Reference Peterson, Smith and Hibbing2020), and formative years (Dassonneville Reference Dassonneville2020; Prior Reference Prior2010) are often used interchangeably. The concept of impressionable years generally assumes that individuals’ attitudes are influenced during a particular stage of life, typically between adolescence and early adulthood. For instance, Koskimaa and Rapeli (Reference Koskimaa and Rapeli2015) refer to late adolescence (16–18 years old) as a critical period for political socialization. Similarly, Niemi and Sobieszek (Reference Niemi and Sobieszek1977) suggest that adolescents develop an understanding of political institutions and specific political attitudes only after this stage. In his multi-survey study on the persistence of political interest, Prior (Reference Prior2010) uses different age ranges (13–18 years old), depending on the surveys analyzed. When analyzing whether macroeconomic conditions shape long-term attitudes toward immigration, Cotofan et al. (Reference Cotofan, Dur and Meier2024) define the impressionable years as 18 to 25.
While attitudes toward immigration may be rooted in experiences specific to particular times in one’s life, they are also likely shaped by local realities, from country to city to neighborhood. Cohort effects are typically attributed to significant historical events or societal changes that impact individuals born within a specific timeframe. These effects have been examined across various disciplines. For instance, Blais et al. (Reference Blais, Gidengil and Nevitte2004) attribute declining voter turnout in Canada to cohort effects, noting that post-baby boomer generations are less likely to perceive voting as a moral obligation. Similarly, Franklin et al. (Reference Franklin, Lyons and Marsh2004) identify a spillover effect from low-turnout elections on the voting habits of first-time voters. In the specific context of immigration attitudes, Jeannet and Dražanová (Reference Jeannet and Dražanová2019) argue that landmark events alone cannot fully explain intra-cohort variation. They introduce the concept of a diffuse political context during a cohort’s impressionable years, emphasizing that exposure to specific political events or regime changes shapes long-term attitudes.Footnote 4 McLaren and Paterson (Reference McLaren and Paterson2019) suggest that the political climate, such as the presence of far-right parties, also influences attitudes during formative years. As a general trend, the authors recognize that younger cohorts – who are overall more educated and secular – tend to hold significantly more positive views on immigration than their predecessors, and “is likely to be a result of the increased socialization in a context of diversity for these cohorts” (McLaren & Paterson Reference McLaren and Paterson2019, 677). Similarly, Cotofan et al. (Reference Cotofan, Dur and Meier2024) find that experiencing economic recessions and immigration inflows during early adulthood significantly affects attitudes toward immigration over the life course.
Importantly, the literature on formative years connects closely to theories of cultural transmission and intergenerational socialization (Bisin & Verdier Reference Bisin and Verdier2001). Models of cultural transmission emphasize that parents transmit values and beliefs – either intentionally or through everyday practices – to their children, thereby shaping long-run preferences (Doepke & Zilibotti Reference Doepke and Zilibotti2017; Sapiro Reference Sapiro2004). In this framework, early-life environments interact with family background in the formation of durable attitudes. Parental education, in particular, is often associated with more liberal and cosmopolitan values, higher political engagement, and greater openness toward diversity. Consequently, exposure to ethnic diversity during impressionable years may either reinforce pre-existing norms transmitted within the family or challenge them, depending on the household’s cultural baseline. This perspective suggests that the effect of local diversity during formative years may be heterogeneous across individuals from different parental-education backgrounds, as family socialization can moderate the extent to which external exposure translates into persistent attitudinal change.
While there is a substantial body of research analyzing how immigration levels at various geographical scales influence attitudes toward (Pottie-Sherman & Wilkes Reference Pottie-Sherman and Wilkes2017), we could not find any study specifically addressing whether local exposure during late adolescence/early adulthood is correlated with long-term attitudes. McLaren et al. (Reference McLaren, Neundorf and Paterson2020) argue that exposure to diversity is likely to shape attitudes towards immigration, but they only look at country-wide measurements of such diversity due to, inter alia, data limitations regarding the residential histories of survey respondents in the UK. Looking at the US, Eger et al. (Reference Eger, Mitchell and Hjerm2022) also hypothesize a link between exposure to diversity and attitudes towards immigration but again only measure this at the macro-region or state level. While Cotofan et al. (Reference Cotofan, Dur and Meier2024) included controls for immigration during respondents’ early adulthood, these are national inflows in the context of repeated cross-sectional surveys. Our approach leverages local exposure in a panel study, enabling us to tackle questions regarding the stability and duration (if any) of exposure effects. Mixed results in previous research may be due to differences in the way immigration is measured, the geographical units analyzed, how attitudes are recorded, and variations in the research design (Dinesen et al. Reference Dinesen, Schaeffer and Sønderskov2020; Pottie-Sherman & Wilkes Reference Pottie-Sherman and Wilkes2017). By explicitly focusing on the timing of exposure and its interaction with family background, our framework integrates insights from political socialization, cohort research, and cultural transmission models to study the long-run formation of immigration attitudes.
The theoretical mechanisms underpinning the expected relationship between immigrant communities and attitudes are typically framed at the individual level, but empirical tests often use aggregated data (e.g., at the neighborhood, city, or national level). Contact theory and group-threat theory are commonly cited to explain these relationships, although their original scope conditions – such as shared common goals among individuals – are difficult to test empirically at an aggregate level (Paluck et al. Reference Paluck, Green and Green2018). Thus, we explicitly refrain from using the term contact in this paper and limit ourselves to just exposure. In a similar vein, and using the same German data, Maxwell (Reference Maxwell2019) observes sorting dynamics wherein people with pro-immigration attitudes tend to cluster in urban areas, whereas people opposing migration tend to reside in rural ones. However, the residential context does not cause people to have particular attitudes; rather, people tend to move to areas with higher attitudinal affinity.
3. Data and sample
Our analysis requires combining data on people’s attitudes toward migration, their residential history, and data on the share of immigrants in the total population at the county (Kreis in German) level. We measure self-declared attitudes towards migrants, the share of immigrants residing in the county, residential history, and a set of personal characteristics in the SOEP, which is described in Section 3.1. Section 3.2 provides summary statistics for our main sample.
3.1. The German socioeconomic panel
Our data source is the German Socioeconomic Panel (SOEP). The SOEP is a longitudinal survey conducted by the German Institute for Economic Research (DIW Berlin). It collects detailed information on households and individuals in Germany, covering a wide range of socio-economic factors. The survey panel started in 1984. Currently, it has conducted almost 40 waves of data collection. The dataset covers approximately 30,000 individuals in approximately 22,000 households each year.
The SOEP records many individual demographic and socioeconomic characteristics, such as sex, year of birth, and highest educational level achieved. It also includes two key variables for us. First, since 1999, the SOEP has asked respondents about their feelings on immigration. We use the yearly survey question “Are you worried about migration to Germany?” as a proxy for attitudes toward immigration (answers to the question are “1) Very; 2) Somewhat; 3) Not at all.”). Second, since 1995, the SOEP has recorded the share of migrants living in each county.
For our empirical analysis, we use the SOEP waves from 1999 (the first wave with the attitudinal question) to 2022, the most recent wave available at the time of writing. An important feature of the SOEP is that it documents the specific residential history of its respondents. Using restricted regional data, we can reconstruct the county in which each respondent lived at the time of the interview. In addition, the SOEP collects detailed information on each respondent’s parents, allowing us to determine their socioeconomic background during their formative years.
We study how the presence of immigrants in an area during formative years affects their later attitudes. We define 18 as the formative year. This choice maximizes our sample given the data constraints since the migrant share data begins in 1995. Setting the formative age at 18 lets us include everyone who turned 18 in 1995 or later. Choosing age 17 would exclude the 1995 cohort because we would need migrant data from 1994 for them. As Figure 1 shows the 1995 cohort is one of the largest in our data. Age 18 also matches two theoretical criteria: most people still live at home, and the age falls within the formative years identified by the academic literature. Figure 2 illustrates our cohort selection. The timeline marks four key dates: the SOEP start in 1984, the first migrant share data in 1995, the first attitudinal data in 1999, and the last survey wave in 2024 (referring to the calendar year 2022). We drop respondents who turned 18 between 1984 and 1995 because we lack migrant share data for their formative year. We keep respondents who turned 18 between 1995 and 2018. The 2018 cut-off ensures that we observe each person’s attitudes at least four years after their formative year. We measure the migrant share in the county where each person lived at age 18. We then track their attitudes in later survey waves, regardless of subsequent moves. We focus on people observed at age 18 in the SOEP with complete residential histories. This restriction sharply reduces our sample because the original SOEP cohort includes mostly older respondents. We impose a four-year lag between the observation of attitudes in surveys and the administrative record of immigrant presence. Insights from the literature suggest that people may be sorting into places based on a variety of factors (Cohen & Pardos-Prado Reference Cohen and Pardos-Prado2025; Maxwell Reference Maxwell2019), and it is reasonable to think that respondents might gravitate towards places that have a higher affinity with them. Under these circumstances, the association between exposure and attitudes might become difficult to disentangle. However, by imposing a temporal separation between these observations, we block the possibility of reverse causation.
Cohorts in our sample.

Timeline and sample restrictions.

3.2. Descriptive analysis
Our analysis focuses on participants in the SOEP who turned 18 between 1995 and 2018 (see Figure 2 for the selection criteria). Our main sample consists of 5,127 individuals, observed on average five times between 1999 and 2022, for a total of 27,727 individual-year observations.
Table 1 presents the summary statistics for our main sample. Gender is balanced, and the vast majority of the respondents have German citizenship (94%). On average, 65% of the respondents report being very or somewhat concerned about the level of migration to Germany.
Summary statistics

Figure 3 plots attitudes by survey year. Two events stand out. Concern peaked in 2016 during the Syrian war; openness peaked in 2020–21 during the COVID pandemic.
Attitudes toward migration in Germany, 1999–2021.
Note: The figure shows responses to the SOEP question “Are you worried about migration to Germany?” by survey year. Sample restricted to respondents who turned 18 between 1995 and 2019.

The average respondent turned 18 in 2003. Birth years range from 1977 to 2000, and our cohort restrictions bound the age distribution at survey time to 22–45, with an average age of 27.
Six percent of the sample completed primary school only, 72% completed secondary education, and 21% completed tertiary education or above.Footnote 5
On average, 8% of the population in respondents’ county at age 18 were migrants, ranging from just under 1% to almost 30%. Figure 4 maps this variation. Migrants concentrate in former West Germany and around major cities: Berlin, Hamburg, Köln, Frankfurt am Main, München, and Stuttgart. Low-migration counties, common in the east, average between 0% and 5%; high-migration counties near western urban centers exceed 20%.
Administrative division by county and share of immigrants, 1995–2018.
Note: Panel 5 shows the subdivision of Germany in counties (Kreis). Panel 6 shows the average share of migrants in each county over the 1995–2018 period.

Figure 5 plots within-county migrant shares over time. Shares were stable until around 2010, then rose across most counties. The levels differ sharply – from near zero in Sömmerda to above 25% in Offenbach, reflecting lasting regional differences in migrant settlement.
Immigration share by county, 1995–2018.
Note: The figure shows the share of migrants in each Kreis from 1995 to 2018. Each gray line represents a German Kreis. Three counties are highlighted: Offenbach am Main (highest average share), Sömmerda (lowest average share), and Berlin. Migrant share is defined as the percentage of foreign-born residents in each county. Source: SOEP regional data.

We close this section by examining how attitudes evolve over the life cycle. Figure 6 cross-tabulates responses for the same person in consecutive survey waves. The majority of the sample lies on the diagonal, meaning that attitudes tend to be stable. However, a substantial share (ranging from 35% to 40%, approximately) of the sample changes their opinion over time. Thus, while opinions on immigration tend to be stable over the lifetime, change is not rare.
Transition matrix of attitudes between survey waves.
Note: The figure cross-tabulates responses to the question “Are you worried about migration to Germany?” for the same individual in consecutive survey waves. Each cell shows the share of respondents with a given response in wave
$t$
(rows) who gave each response in wave
$t + 1$
(columns). Rows sum to 100%. Sample restricted to respondents who turned 18 between 1995 and 2018 and appear in at least two consecutive waves.

Figure 7 shows the direction of this change. Pooling all surveys, we find descriptive evidence of an aging effect: respondents tend to report greater concern about immigration as they grow older.
Attitudes toward migration by age.
Note: The figure plots coefficients on age from an individual fixed effects regression. The dependent variable equals one if the respondent reports being “very” or “somewhat” worried about migration to Germany. The omitted category is age 22. Bars show 95% confidence intervals. Standard errors clustered at the individual level. The sample includes all respondents aged 22 to 75.

To recap, our main descriptive findings are in line with insights from the academic literature. Figure 7 shows evidence of a well-documented dynamic, namely the hardening of immigration attitudes as people age,Footnote 6 in line with broader trends in political attitudes (O’Grady & Abou-Chadi Reference O’Grady and Abou-Chadi2019; Peterson et al. Reference Peterson, Smith and Hibbing2020; Prosser et al. Reference Prosser, Fieldhouse, Green, Mellon and Evans2020; Sturgis & Jennings Reference Sturgis and Jennings2020; Tilley & Evans Reference Tilley and Evans2014). Figure 8 displays a much-discussed cohort effect, whereby younger generations tend to have increasingly favorable attitudes towards immigration McLaren and Paterson (Reference McLaren and Paterson2019). Finally, while the literature has emphasized the stability of political attitudes (Devine & Valgaròsson Reference Devine and Valgaròsson2023; Kustov et al. Reference Kustov, Laaker and Reller2021; Lancaster Reference Lancaster2020), 6 shows that such changes are far from rare.
Residual variation in migrant shares across counties.
Note: The figure shows migrant shares after removing county and cohort fixed effects. Each gray line represents one Kreis. Highlighted: Offenbach am Main, Sömmerda, and Berlin.

4. Empirical framework
We estimate the effect of exposure to immigration during formative years on individuals’ later-life immigration attitudes as follows:
The dependent variable
$At{t_{i,t}}$
measures immigration attitudes for individual
$i$
in survey year
$t$
. We dichotomize the attitudinal question, coding
$At{t_{i,t}} = $
if the respondent reports being “very” or “somewhat worried” about immigration and 0 if not worried at all. This binary specification facilitates the interpretation of the marginal effects. Results remain substantively unchanged if we instead pool “somewhat worried” with “not worried,” or if we estimate an ordered probit model rather than this linear probability specification.Footnote
7
The key independent variable
$ShareMigr_{c\left( i \right),j\left( i \right)}^{18}$
captures the share of migrants in the individual’s county of residence
$c$
at the time their cohort
$j$
turned 18, representing exposure to immigration during late adolescence.
${X_i}$
includes individual-level controls such as gender, education, and socioeconomic background.
A key identification concern relates to the potential endogeneity of migrant exposure; that is, the effect of the share of migrants in county
$c$
when cohort
$j$
turned 18,
$ShareMigr_{c,j}^{18}$
, may be biased due to unobserved factors or simultaneous determination. Migration flows are not randomly distributed across space or time; they may respond to local economic conditions, political preferences, or other unobserved characteristics that could also shape individuals’ subsequent attitudes toward immigration. For instance, counties experiencing stronger economic growth might attract more migrants and foster more positive immigration attitudes, leading to an upward bias in
${\beta _1}$
. Conversely, if migrants avoid counties with more negative sentiment, this could bias estimates downward.
Our model includes cohort fixed effects (
${\gamma _{j\left( i \right)}}$
) to absorb common shocks or trends affecting all individuals who turned 18 in the same year, survey-year fixed effects (
${\tau _t}$
) to account for contemporaneous factors influencing all respondents in a given survey wave, and county-of-age-18 fixed effects (
${\kappa _{c\left( i \right)}}$
) to control for time-invariant regional characteristics. Identification, therefore, comes from within-county, across-cohort variation in migrant shares at age 18. Figure 8 illustrates this variation. It plots the migrant share after removing our set of fixed effects. This residual variation identifies
${\beta _1}$
. We cluster standard errors two-way at the individual and county
$\times$
cohort levels, which is the level at which treatment varies, allowing for arbitrary correlation among individuals who share the same exposure.
Importantly,
$ShareMigr_{c,j}^{18}$
is measured many years before the outcome variable, as it captures exposure to immigration around the time individuals turned 18, while attitudes are observed later in adulthood. This temporal separation reduces concerns about reverse causality, that is, current immigration attitudes cannot influence historical migrant inflows.
We also conduct several robustness checks. We control for contemporaneous economic factors (e.g., unemployment rate) to address time-varying economic conditions that might simultaneously affect attitudes and inflows. We also estimate heterogeneous effects by individual characteristics, particularly by parental background. If endogeneity were driving the results, we would expect this bias to operate similarly across individuals within the same county and cohort. Finding systematic heterogeneity in the estimated effects across individual or parental characteristics would be inconsistent with an endogeneity-driven explanation, thereby alleviating remaining identification concerns.
5. Results
We examine how exposure to immigration at age 18 shapes immigration attitudes in adulthood by estimating equation (1). Table 2 presents the baseline estimates, reporting specifications with progressively richer sets of fixed effects. Once cohort, survey-year, and county-of-residence-at-18 fixed effects are included, a higher migrant share during the impressionable years significantly increases the probability of expressing concern about immigration. The change in coefficient magnitude across specifications indicates that controlling for time-invariant unobservables, particularly at the county level, is important for identification purposes. Specifically, omitting cohort fixed effects yields similar estimates, whereas excluding county fixed effects leads to substantive changes in the estimated coefficients, indicating potential bias.
Effect of local migrant exposure at age 18 on adult attitudes

Note: Standard errors clustered at the individual and county
$\times$
cohort level. *p < 0.10, **p < 0.05, ***p < 0.01.
Our preferred, most saturated specification implies that a 1 percentage-point (p.p.) increase in the migrant share at age 18 raises the likelihood of concern by roughly 1.5 p.p. Importantly, this effect is specific to early-life exposure. As shown in Table 3, analogous measures of migrant presence at age 30 are small and statistically insignificant, supporting the interpretation that attitudes crystallize during late adolescence rather than respond to contemporaneous local conditions.
Effects of migrant exposure at ages 18 and 30

Note: Standard errors clustered at the individual and county
$\times$
cohort level. All regressions control for sex, education, and German origin. *p < 0.10, **p < 0.05, ***p < 0.01.
In addition, Table 4 shows that contemporaneous migrant shares are negatively correlated with immigration concern, whereas exposure at age 18 remains strongly positive, suggesting that early- and later-life contexts operate through distinct mechanisms. Results are robust while including the contemporaneous unemployment rate as well, as a proxy for local-level time-varying socio-economic conditions. Taken together, these findings indicate that unmediated exposure to demographic change during the formative phase exerts a persistent influence on immigration attitudes, above and beyond both time-invariant county characteristics and contemporaneous shocks.
Effects of immigration exposure and local labor market conditions at age 18

Note: Standard errors clustered at the individual and county
$\times$
cohort level. All regressions control for sex, education, and German origin. *p < 0.10, **p < 0.05, ***p < 0.01.
We next examine whether the effect of early exposure to immigration varies across individuals with different demographic and family backgrounds. Table 5 examines heterogeneity across individual characteristics such as gender, education, and residence in rural areas.Footnote 8 The interaction between migrant share at age 18 and the female indicator is small and statistically insignificant, indicating that we do not find evidence of differential effects between men and women. For instance, a one percentage point increase in the migrant share at age 18 raises the probability of expressing concern about immigration by approximately 1.6 percentage points for men and 1.7 percentage points for women, indicating nearly identical responses across genders. This finding suggests that the mechanisms underlying our results are unlikely to operate through gender-specific channels, such as differential labor market competition. Instead, the influence of early exposure appears to reflect broader processes of political and attitudinal formation during late adolescence that affect young men and women in comparable ways. We also test whether the effect differs by respondents’ own education. While individuals with tertiary education are, on average, significantly less likely to express concern about immigration, the interaction terms between education and migrant exposure are small and statistically insignificant, indicating no clear evidence that the effect of formative exposure varies systematically across educational groups. Columns (3) and (4) of Table 5 extend the baseline specification by introducing a rural indicator at age 18 and its interaction with migrant exposure. The coefficient on the rural dummy is positive and statistically significant, suggesting higher baseline concern among individuals raised in rural areas. However, the interaction term between rural residence and migrant share at age 18 is negative and statistically significant, implying a smaller marginal effect of exposure in rural contexts. This pattern indicates that the attitudinal impact of early exposure is attenuated outside urban settings, suggesting that exposure in more densely populated and diverse environments may be more salient or socially consequential in shaping long-run attitudes. Put differently, intergroup contact – potentially more prevalent or more meaningful in rural settings – may mitigate perceived group threat and thus dampen the effect of early exposure.
Heterogeneity by individual and local characteristics

Note: Standard errors clustered at the individual and county_cohort level. All regressions control for German origin. *p < 0.10, **p < 0.05, ***p < 0.01.
Table 6 further investigates heterogeneity by parental education. Although individuals from more educated family backgrounds tend to express somewhat more favorable attitudes toward immigration overall, the interaction terms between parental education and early immigration exposure are generally small and statistically insignificant. Importantly, the estimated effect of migrant exposure at age 18 remains stable across all specifications. While the interaction coefficients are estimated with limited precision, the results suggest that the influence of early exposure operates relatively uniformly across gender, education levels, and family backgrounds.
Heterogeneity by parental education

Note: Standard errors clustered at the individual and county
$\times$
cohort level. All regressions control for sex, own education, and German origin. *p < 0.10, **p < 0.05, ***p < 0.01.
Taken together, these results indicate that the influence of early exposure likely reflects broader processes of political socialization and perception formation during the impressionable years, which affect subgroups of the population (e.g., young men and women) in largely similar ways but are more pronounced in urban contexts than in rural ones.
6. Conclusions
This paper examines whether exposure to immigration during the formative years leaves a persistent imprint on individuals’ attitudes toward immigration later in life. Using panel data from the German Socio-Economic Panel combined with administrative information on migrant shares at the county level, we link individuals’ immigration attitudes observed in adulthood to the demographic environment in which they lived at age 18. Our empirical strategy exploits within-county variation in migrant shares across birth cohorts while controlling for cohort, survey-year, and regional fixed effects.
Our results show that exposure to higher shares of immigrants during late adolescence is associated with more negative attitudes toward immigration in adulthood. In our preferred specification, a one percentage point increase in the migrant share in an individual’s county at age 18 raises the probability of expressing concern about immigration by approximately 1.5 percentage points. Importantly, this effect appears to be specific to the formative period: exposure to immigration later in life does not have a comparable effect. Moreover, the relationship remains robust when controlling for contemporaneous migrant shares and local economic conditions, suggesting that early-life environments play a distinct role in shaping long-run immigration attitudes.
We also explore whether the effect of early exposure varies across different population groups. The evidence suggests that the influence of formative exposure operates relatively uniformly across gender and educational groups but differs between urban and rural areas. While individuals with higher levels of education tend to express more favorable attitudes toward immigration overall, the impact of early immigration exposure does not differ systematically across educational levels or between men and women. Similarly, we find limited evidence that family background, proxied by parental education, significantly moderates the effect of early exposure. By contrast, we uncover heterogeneous treatment effects across spatial environments, as the negative impact of early exposure on later-life attitudes is primarily driven by urban contexts. This is consistent with mechanisms of perceived group threat in more densely populated and diverse settings, while being attenuated in rural contexts where more direct and repeated intergroup contact may mitigate such perceptions.
Taken together, these results suggest that the formative environment shapes immigration attitudes through broad processes of political socialization and perception formation, rather than through narrowly defined economic or demographic channels.
Our findings contribute to the literature on the formation of political and cultural attitudes by highlighting the importance of the timing of exposure to demographic change. While much of the existing research focuses on contemporaneous immigration levels or national-level shocks, our results indicate that local exposure during the impressionable years can have long-lasting consequences for immigration preferences. By combining granular local data with long-run panel information on individuals’ attitudes, this study provides new evidence that early contextual environments shape the evolution of political opinions over the life course.
More broadly, these findings speak to ongoing debates about how societies respond to demographic change. If attitudes toward immigration are partly shaped by experiences during adolescence, then policies and local contexts that influence young individuals’ exposure to diversity may have persistent political consequences. At the same time, the relatively small magnitude of the estimated effects suggests that early exposure is only one factor among many contributing to the formation of immigration attitudes. Future research could explore the specific mechanisms through which early local exposure influences long-run preferences – for instance, through peer interactions or schooling environments – and examine whether similar patterns arise in other national contexts.
Acknowledgements
We are grateful to seminar participants at Utrecht University and University of Milan Bicocca for thoughtful comments and suggestions. All data and computer programs are available upon request. The usual disclaimer applies.












