Donald Trump won Tuesday’s election by racking up big margins in counties that are, on average, older, whiter and less-educated than the rest of the U.S.

The demographics of Trump Country are similar to those of the places that Mitt Romney won in 2012. Romney, like other recent Republican nominees, drew strong support in rural areas, which tend to be whiter and have fewer residents with college degrees. But Trump extended the GOP’s advantages in those areas, in many cases substantially.

This analysis is based on county-level voting data from Dave Leip’s Atlas of U.S. Presidential Elections. The data is preliminary: We have data for 2,902 of 3,142 U.S. counties, but vote tallies in some of those 2,902 counties are incomplete. The numbers for California and Washington, notably, are missing many votes. Demographic data comes from the 2010-14 American Community Survey.

Demographic patterns alone won’t resolve the “why did Trump win?” question, especially because, as Jed Kolko wrote Thursday, economic, demographic and cultural factors are frequently interconnected. But they do show how Trump accelerated recent partisan shifts and remade the electoral map — in the process further reshaping the Republican Party.

Take age, for instance. Trump and Romney both did well in counties with a larger share of older people, but Trump did better. Trump outperformed Romney by 3 percentage points in counties with less than 20 percent of the population age 60 and over but by nearly 12 points in counties where this group constituted over 30 percent of the population. (All trend lines in the charts below are weighted by county-level voter turnout in 2016.)

Race tells a similar story. Perhaps surprisingly, given his comments about Mexican immigrants and other minority groups, Trump did better than Romney in “majority minority” counties, those where non-Hispanic whites make up less than 50 percent of the population. His margins there were 4.5 percentage points better than Romney’s (though he lost them to Hillary Clinton by a wide margin). But in counties where the white population share was above 75 percent, Trump did 13 percentage points better than Romney, and in counties where whites are more than 90 percent of the population, Trump outperformed Romney by an astounding 17 points.

While Trump did well in whiter areas, he also overperformed in places that have seen an influx of nonwhites in recent years. A Wall Street Journal analysis before the election found that Trump was especially popular in counties that had become significantly more diverse over the past 15 years. These areas are often still mostly white, but are changing quickly.

Trump Country has fewer immigrants, too: The higher the foreign-born population share of a county, the worse Trump performed. In the 91 counties where immigrants form more than 20 percent of the population, Trump did about 2 percentage points worse than Romney did in 2012, even though he outperformed Romney by about 2.5 points overall. But in the 503 counties where immigrants are less than 1 percent of the population, Trump beat Romney’s margins by 17 points.

But perhaps no demographic variable reflects Trump’s electoral success better than education does. In counties where less than 20 percent of the population has a bachelor’s degree or higher, Trump exceeded Romney’s margins by 14 percentage points. And, conversely, counties with more than 40 percent of the population having completed higher education, Trump did 6 percentage points worse than Romney.

CORRECTION (Nov. 11, 2:13 p.m.): An earlier version of a chart accompanying this article misstated the type of counties in which Trump outperformed Romney. He did better in less-educated counties, not more-educated counties.

Reuben Fischer-Baum and Dhrumil Mehta contributed research.