U.S. riot police officers take part in a border security drill at the U.S.-Mexico international bridge, as seen from Ciudad Juárez, Mexico, on Monday. (AFP/Getty Images)

As the midterms loom, President Trump and the Republican Party have ratcheted up their rhetoric on immigration. Monday, the Trump administration announced it would be sending 5,200 additional troops to the U.S.-Mexico border to prevent the Central American migrant caravan from crossing into the United States. Last week, the president claimed without evidence that “unknown Middle Easterners” were part of the caravan. Republican candidates throughout the United States are echoing this tone, firing up their base with renewed calls for border walls, deportations and even an end to birthright citizenship. This talk appears to be what many voters want to hear.

Using fearmongering and anti-immigrant rhetoric to mobilize support is nothing new. Yet how does this rhetoric influence individual attitudes? Our large-scale analysis of how European elections affect attitudes toward immigration offers some clues.

Scholars have long touted the benefits of elections, such as civic engagement, for established democracies. Usually, scholars examine elections’ possible negative effects, like social polarization or conflict only in new democracies. But the imminent midterms, and lingering effects of U.S. and European recent elections, remind us that elections can have negative social effects even in established democracies.

Here’s how we did our research

To examine how elections affect attitudes toward immigration, we examined variation in interview dates in the European Social Survey. Because of the way the survey is conducted, the date that an individual is surveyed is random, with some people being questioned closer to elections and others further from elections. While individual responses vary, if there are large, statistically significant average differences between responses at different distances from elections, this indicates that the elections are causing, not just correlated with, these attitudinal changes.

Integrating information from over 500 elections between 2002 and 2015 across 28 European countries and nearly 300,000 respondents, we find that as elections approach, Europeans hold more negative attitudes toward immigration. When we delve into this a bit further, we find that while the overall effect is negative, individual attitudes are actually becoming more polarized, with more people viewing immigration either very positively or very negatively.

These negative effects linger even after the elections. We see a roughly symmetrical effect on attitudes pre- and post-election. But these effects are not permanent. As elections recede, individual attitudes become less negative and polarized, returning to a more moderate average in the period before a new election approaches.

When party rhetoric against immigrants gets heated, public attitudes polarize

When we examine why elections have these effects, we find that party rhetoric seems to matter a great deal. Integrating data from the Manifesto project, which measures the percent of party platforms dedicated to different topics in each country, we find that elections with high levels of nationalist and anti-immigrant rhetoric affect individual attitudes much more strongly than those with low levels of such rhetoric.

This effect is separate from overall issue salience. We measure salience using data from Google Trends on the number of Google searches of the term “immigration,” in the native language of each country, during election periods versus non-election periods. While immigration becomes more salient during election periods, even when we control for this salience in our analysis, party manifestos continue to have an outsize effect.

In other words, whether individuals hear more about immigration more generally doesn’t have much effect; rather, their more extreme attitudes correlate with parties’ rhetoric specifically. We also find that this does not appear to be solely about race; respondents feel equally negatively toward immigrants who share their race or ethnicity.

Interestingly, elections that include the highest levels of anti-immigrant and nationalistic rhetoric result in high levels of polarization but not the most negative overall attitudes.  Elections with the highest level of anti-immigrant rhetoric appear to bring a backlash, presumably because extreme rhetoric alienates more moderate individuals. Elections with above-average anti-immigrant rhetoric are the ones associated with the highest levels of anti-immigrant sentiment overall.

Anti-immigrant election rhetoric affects attitudes toward other marginalized groups as well

Elections shot through with anti-immigrant rhetoric appears to polarize attitudes toward marginalized groups more broadly, increasing highly negative and highly positive attitudes toward welfare systems and LGBT rights. We expect we would find similar results if we were to examine attitudes to other hot-button social issues, such as reproductive rights or responses to sexual assault and the #MeToo movement.

So what does this mean for the U.S.’s current political moment?

First, given the strong anti-immigrant rhetoric coming from the Republican Party, we expect that many Americans’ attitudes will become increasingly anti-immigrant as well.

Second, we would not expect this to dissipate immediately after the election — although as time goes by, individual attitudes should soften and return to a less negative average.

Third, Trump’s and other Republicans’ anti-immigrant rhetoric, while effective in energizing their base, may turn off some more moderate voters.

Finally, when parties choose to reject such rhetoric, elections need not have such polarizing effects.

Elizabeth Dekeyser and Michael Freedman are PhD candidates in political science at the Massachusetts Institute of Technology.