Donald Trump performed best on Tuesday in places where the economy is in worse shape, and especially in places where jobs are most at risk in the future.

Trump, who in his campaign pledged to be a voice for “forgotten Americans,” beat Hillary Clinton in counties with slower job growth and lower wages. And he far outperformed her in counties where more jobs are threatened by automation or offshoring, a sign that he found support not just among workers who are struggling now but among those concerned for their economic future.

In the months leading up to Tuesday’s vote, experts debated how much Trump’s support was driven by economic anxiety or by racism, xenophobia or other factors. These reasons are not mutually exclusive, of course, and the debate will continue long into Trump’s presidency. But county-level voting results suggest that economic issues underpinned at least some of Trump’s support.

The relationship between economic issues and Trump’s support is not straightforward. Earlier analyses, based on pre-election polls, suggested that Trump’s backers were wealthier on average than Clinton’s. Actual election results show no correlation between counties’ September 2016 unemployment rates and their level of support for Trump — places with higher unemployment rates were no more likely to vote for Trump than those with lower rates. (County-level voting data is provided by Dave Leip’s U.S. Election Atlas. These figures are from version 0.2, which are preliminary, contain omissions and possibly errors and will be revised.)

Unemployment, however, is a crude measure of a local economy. The government’s official definition of unemployment ignores people who have stopped looking for work or who have moved away altogether, and it doesn’t distinguish between a full-time job at a factory and a part-time job at a fast-food restaurant. Measures that do account for these factors generally suggest a stronger relationship between the economy and Trump’s support. Counties with weaker job growth since 2012, for example, were more likely to support Trump; the same is true for places with lower average earnings among full-time workers.

Economic anxiety is about the future, not just the present. Trump beat Clinton in counties where more jobs are at risk because of technology or globalization. Specifically, counties with the most “routine” jobs — those in manufacturing, sales, clerical work and related occupations that are easier to automate or send offshore — were far more likely to vote for Trump.

Comparing Trump’s vote share and other variables can only take us so far, however. For the most part, Trump did better in places that typically vote Republican — there is a strong correlation between how Trump performed in 2016 and how Mitt Romney performed four years earlier. So if routine jobs tend to be concentrated in Republican-leaning areas — as I found a few months ago — that doesn’t necessarily reveal much about whether economic anxiety fueled Trump’s support, in particular.

Instead, to understand what drove Trump’s victory, we can look at how Trump’s margin against Clinton in 2016 compared with Romney’s against President Obama in 2012. Sure enough, the swing toward Trump was much stronger in counties with a higher share of routine jobs; the swing toward Trump was also stronger where unemployment was higher, job growth was slower and earnings were lower.

Demographic factors such as age, race and immigrant share also correlate with the swing toward Trump, although among these only age correlates as strongly as routine job share. However, it’s nearly impossible to disentangle economic factors from other explanations for Trump’s victory because demographic characteristics and economic conditions are themselves related: Counties with older populations tend to have higher unemployment, slower job growth and a higher routine-job share. And some measures are clearly intertwined with both economic and social issues. For instance, counties where more adults are college educated have dramatically higher earnings and a lower routine-job share, but also lots of other favorable social, health and economic outcomes.

Still, it is clear that the places that voted for Trump are under greater economic stress, and the places that swung most toward Trump are those where jobs are most under threat. Importantly, Trump’s appeal was strongest in places where people are most concerned about what the future will mean for their jobs, even if those aren’t the places where economic conditions are worst today.