The biggest issue in the Democratic presidential primary isn’t health care or immigration or gun control. It’s electability. A strong majority of Democratic voters report that it’s more important that the party nominate a candidate who can beat President Trump than someone they agree with on the issues.

But electability is hard to measure. Some polls ask voters who they would pick in a hypothetical matchup between each Democratic candidate and Trump. Unfortunately, these polls have only been as accurate as random chance at picking winners in the past, given how much can change over the course of an election.

The electoral college adds another complication. In 2016, Hillary Clinton won nearly 2.9 million more votes than Trump — reminding us that winning a majority of voters doesn’t mean winning the presidency.

But early head-to-head polls aren’t useless. They reveal important demographic patterns that help us understand how candidates would perform in the electoral college. A candidate who can’t appeal to key demographic groups in swing states will have a much harder time winning the presidency.

So which of the leading Democratic candidates has demographic strengths that would be an advantage in the electoral college?

Here’s how I did my research

To answer this question, I used data from two recent Quinnipiac national polls that reported how different demographic groups said they would vote in hypothetical matchups between Trump and each of the five major Democratic candidates. With this, we can measure the difference between candidates’ support in each demographic group and their overall level of support.

Next, we compare these differences to the results of the 2016 election, asking whether a candidate is doing better or worse than Clinton did, and with which groups. Using these comparisons, and a statistical model built from state election returns, exit polls and census data, we can adjust the 2016 results to create a hypothetical 2020 election. This lets us predict which states each candidate would win, if they won the same fraction of the national popular vote as Clinton.

Last, we can turn a knob on the model, so to speak, to ask what would happen if a candidate won more or less of the popular vote than Clinton did. There’s uncertainty in the underlying polls, which carries over into the predictions; we don’t know exactly what would happen if Joe Biden won 48.5 percent of the national popular vote, for example. So the model gives probabilities, predicting that he would win Virginia 98 percent of the time and lose Minnesota 75 percent of the time, based on how he is polling among that state’s major demographic groups and how much of the state’s electorate each group represents.

To check this approach, I performed the same analysis on four early polls from 2015. The model indicated that Clinton would have a hard time winning the Rust Belt states, because she was performing poorly with white men and voters without a college degree. It estimated that to win Pennsylvania, Michigan, Wisconsin and Ohio, she would need an additional 0.6 percent in the popular vote — over three-quarters of a million votes — than Barack Obama won in 2012. These predictions come from national polling matchups in which Clinton was leading Trump by more than double her eventual margin.

Overall, Democrats are at a disadvantage in the electoral college — but Elizabeth Warren and Pete Buttigieg might do best

In the figure below, you can see how each candidate’s popular vote would translate into electoral votes, according to the model. Candidates with an electoral college advantage win more electoral votes for the same national popular vote totals, because the demographic groups that dominate key swing states prefer that candidate. You can see which candidate gets more electoral college bang for each vote by whose lines are highest for each popular vote percentage.

Every Democratic candidate would need to win more than 50 percent of the popular vote to win the electoral college. But exactly how much varies by candidate: Warren makes it to 270 electoral votes first, with about 50.7 percent of the popular vote, followed by Buttigieg, then Kamala D. Harris, and finally Joe Biden and Bernie Sanders. These estimates are not perfect; though Warren wins first most of the time, she isn’t guaranteed to do so.

To understand these patterns, let’s look at two key sets of swing states: the Rust Belt states of Michigan, Pennsylvania and Wisconsin, which were key to Trump’s victory in 2016; and the Southwestern states of Nevada and New Mexico.

The graph below shows how well a Democrat must do nationally to win back the Rust Belt. On average, Democratic candidates poll 7.4 percent lower among whites than among the general population. But Buttigieg polls only 6.4 percent lower. As a result, he can usually win these states with 49 percent of the national popular vote — and so would win more electoral votes, on average, than his competitors.

But in Nevada and New Mexico, Warren wins first. While on average, the Democratic candidates poll 8.9 percent higher among Hispanics than among the general population, Warren polls 11 percent higher. As a result, she wins these states with about 51.1 percent of the national popular vote, compared to last-place Sanders with about 52.5 percent.

Current projections suggest that Warren could win with the lowest national vote total

To capture the presidency, Democrats need to win both the Southwest and the Rust Belt — and the Southwest will probably be more challenging than the Rust Belt. While that may be surprising considering the 2016 election, in the 2012 election Obama’s margin in Nevada was narrower than in Wisconsin and Michigan.

Among the top Democratic candidates, Warren wins the Southwest — and the presidency — with the lowest average share of the national popular vote. Buttigieg’s Rust Belt strength isn’t matched in the Southwest. He usually needs a slightly larger popular-vote margin to reach 270 electoral votes.

But plenty can and will change between now and November 2020

Recessions, wars and scandals can — and often do — upend any presidential race. These conclusions could change with new polling data. And candidates’ demographic strengths will probably shift as the campaign continues. All that means is this analysis isn’t definitive.

But these patterns suggest Biden may be wrong in arguing that he is best positioned to beat Trump. In swing states, he doesn’t perform exceptionally well in any key demographic groups. In contrast, Warren’s support among Hispanics and Buttigieg’s among whites set both up for an easier electoral college victory.

Ultimately, it matters not just how many votes a candidate wins, but where they win them.

Cory McCartan is a PhD student in statistics at Harvard University.

Read more of TMC’s analysis about the 2020 presidential election: