Barack Obama won re-election four years ago largely because the 2012 electorate had more Democrats than Republicans—and because the president held serve with his fellow Democrats. In one sense, the story of the 2016 election can be distilled into a single question: Can Hillary Clinton do likewise?

The Democratic Party advantage in 2012 was about six percentage points. (Roper and Gallup had this figure, as did the exit polls, while the YouGov poll had it as seven points). Obama won over 90 percent of these Democrats, while Mitt Romney was doing similarly among Republicans.

To make up for the six-point disadvantage among partisans, Romney had to carry Independent voters decisively, a feat he could not pull off. Independents split nearly evenly between the two candidates. This was neither an aberration nor personality driven. As University of California, San Diego political scientist Gary C. Jacobson has documented, the same phenomenon occurred in down-ticket balloting.

“Record levels of party loyalty in the presidential contest carried over into House and Senate elections,” Jacobson notes. So in this partisan atmosphere, how does the 2016 election stack up?

Beginning in May 2015, YouGov began surveying the same 5,000 people, and by late August/early September it questioned them for the 13th time, looking for any changes in party identification, the degree to which Clinton and Trump can match Obama and Romney in capturing their partisan bases, and how Independent voters, including Democratic and Republican leaners, say they are intending to vote.

We have divided the 13 surveys into three electoral periods: the pre-nomination campaign period (May to December 2015), the primary electoral period (January to early June 2016) which gave us the two nominees, and the campaign pre-Labor Day (June to early September). Table 1 shows the basic breakdown of party identification over the three periods.

These results suggest the Republican ticket is in worse shape than in 2012 because it now has a 9.4 percentage-point gap compared to a six-point gap in 2012. If Hillary Clinton has Obama’s 90 percent of Democrats—and nothing in this data indicates otherwise—she will be hard to beat. Trump would have to win over 60 percent of Independents, and the only times in the modern period where a candidate won over 60 percent of Independents were the landslides of 1972 and 1984, where Richard Nixon and Ronald Reagan won 61 and 63 percent, respectively.

A couple of caveats are worth keeping in mind. The first is that the number of self-identifying Republicans has declined about three percentage points while the pool of Independents has increased about four points. One inference that can be drawn is that this increased cohort of Independents usually votes Republican—and may “come home” to the GOP in the stretch run. This also serves as a reminder of the difference between voters who registered as Independents and truly independent-minded swing voters.

But what about the Democratic side of the equation—and which candidate has the momentum?

These data show that over the course of the campaign, Clinton’s percentage of Democrats has declined from 84 to 76, while Trump’s share of Republicans has increased from 68 to 76.

Moreover, Trump has twice as many Democrats (6 percent) as Clinton has Republicans (3 percent), and she is no longer winning Independents. The good news for her is that the gap between Democrats and Republicans is now larger than in 2012.

Breaking the party variable down, Clinton’s problem is not with strong Democrats but, rather, with those who classify themselves as weak Democrats or leaning Democratic.

Going into the last eight weeks of this campaign, the biggest anomaly is the number of voters who claim to be either voting for a third party, are not going to vote, or are undecided.

In January of 2016, we started tracking these people closely. From then until early June, when the major party nominees emerged, that number held steady at about 20 percent. Once it was clear that the choice was between Trump and Clinton, the number jumped. In May, 19 percent of respondents said they weren’t either Trump or Clinton backers. In June, the percentage climbed to 24 and in July and August, it zoomed up to 31 percent. These disaffected Americans were evenly divided between those who said they were voting third party, those who were undecided between Trump and Clinton, and those who vow to sit this one out.

Given recent electoral experience, this is a very large number. In August of 2012, by way of contrast, the best estimate among experts quoted in the New York Times was that “the actual share of voters who are up for grabs is probably between just 3 percent and 5 percent.

So what do we make of these potential voters in early September? When asked “if you had to choose,” two-thirds expressed a preference, and among those pressed to make a decision, Clinton won, 39 percent to 24 percent.

In short, this means that in early September, the “up for grabs” segment of the electorate, if it were to vote, would give Clinton some needed support.

The 36 percent who did not answer the “if you had to vote” question are distinct from the overall sample in their utter dislike of both candidates. When you put a gun to their heads, they don’t budge much: They tend to characterize Clinton as dishonest and insincere, and Trump as unqualified for the job and as someone who does not understand the problems of average people. Given these negative views toward both candidates, it would seem to take some extraordinary event or events to move these potential voters toward either major candidate.

In sum, it appears that Democrats have an even bigger advantage than they did in 2012 because their margin over Republicans has increased. That’s the good news for Democrats. The bad news is Clinton has not yet sealed the deal with weak and leaning Democrats—and these are voters who are extremely familiar with her and the Clinton brand. Unless and until she reaches Obama’s 90 percent-plus of Democrats in 2012, the race will remain fluid.

Meanwhile, Trump has the same problem with weak and leaning Republicans and is well short of Romney’s 93 percent-plus 2012 numbers. However, because there are fewer Republicans now, his situation is more dire. Among Independents indicating a preference for president, Trump leads Clinton but by nowhere near enough to make up for the partisan gap.

However, the 31 percent of respondents who intend either to vote for a third-party candidate, are undecided or are saying they won’t vote keeps us from concluding that the election is on the way to being decided. This is significant. Obama had a similar lead over Romney four years ago, and won by that margin. But so much of the electorate had its mind made up by this time, there wasn’t much wiggle room.

While it is true that when pushed to vote, the 31 percent prefer Clinton to Trump by 39 percent to 24 percent, this preference is not strong, and more than one-third of these voters still won’t state an inclination one way or the other.

These data show that in early September, Clinton holds a small lead, but it is not conclusive and she will have to firm up her support among Democrats and continue to stay close to Trump among Independents and undecideds in order to win. Trump also has to shore up his Republican Party support and begin to increase his percentage of Independent voters by converting the undecided to him.

Of the two candidates, he has the longer row to hoe.

RealClearPolitics elections analyst David Byler contributed to this article.