The last ballots in the presidential election were cast more than two weeks ago. But votes in 37 states, and the District of Columbia, are still being counted, with the results yet to be officially certified.

President Obama’s national margin over Mitt Romney has increased as additional ballots have been added to the tally. According to the terrific spreadsheet maintained by David Wasserman of the Cook Political Report, Mr. Obama now leads Mr. Romney by 3.3 percentage points nationally, up from 2.5 percentage points in the count just after the election.

Turnout has grown to about 127 million voters, down from roughly 131 million in 2008. The gap could close further as additional ballots are counted. The newly counted ballots have also shifted the relative order of the states.

Immediately after the election, it appeared that Colorado was what we called the “tipping-point state”: the one that gave Mr. Obama his decisive 270th electoral vote once you sort the states in order of most Democratic to least Democratic.

Mr. Obama’s margin in Colorado has expanded to 5.5 percentage points from 4.7 percentage points as more ballots have been counted, however. He now leads there by a wider margin than in Pennsylvania, where his margin is 5.0 percentage points. Neither state has certified its results, so the order could flip again, but if the results hold, then Pennsylvania, not Colorado, will have been the tipping-point state in the election.

Does this suggest that Mr. Romney’s campaign was smart to invest resources in Pennsylvania in the closing days of the campaign?

The short answer is yes. The longer answer is that it might have been better served by contesting Pennsylvania throughout the campaign, rather than just at the last minute.

Pennsylvania alone would not have won the election for Mr. Romney. But if the national climate had been slightly better for him over all, he might have won Ohio and Florida. Winning Pennsylvania as well would have given Mr. Romney the Electoral College, even if he had lost Colorado, Virginia and the other swing states that Mr. Obama in fact carried.

Photo

There is one additional complication for Republicans in Pennsylvania, however: it has often been a close-but-not-quite state for them. They can find 48 percent of its vote pretty easily, but finding 50 percent is difficult; Mr. Romney was hardly the first Republican to make a late play for the state but fail to win it.

The reason has to do with another FiveThirtyEight concept, which we call “elasticity”.

Certain swing states have an especially large number of persuadable voters. New Hampshire is a paradigmatic example of this. About half that state’s voters identify as independents. Moreover, they have demographic characteristics that tend to balance one another out. New Hampshire is overwhelmingly white, for example, and quite wealthy, which tends to favor Republicans. It is also quite well-educated, and socially liberal, which tends to favor Democrats. Many voters in the state may shift their votes along with the political tides. When Democrats are having a reasonably good night over all, as they did in 2012, they can sweep almost all contests on the state ballot. But they can lose almost everything when the political climate works against them, as in 2010. We term this an elastic state.

Pennsylvania is considerably less elastic. Certainly Republicans can do pretty well there when they have a very strong wind at their back, as in 2010. But it has few independent voters, and instead large numbers of people who are almost certain to vote for one or another party, almost no matter what else happens.

The Democratic vote, of course, is highly concentrated in Philadelphia and other counties in the southeastern portion of the state, along with Pittsburgh. Republicans do pretty well everywhere else, and very well in central Pennsylvania.

(So pronounced are the regional variations in Pennsylvania that Republicans were able to devise a redistricting plan in which Democrats won just 5 of the 18 seats for the House of Representatives this year despite their House candidates winning more votes over all throughout the state.) We can quantify this by means of the FiveThirtyEight elasticity scores. Mr. Obama leads in Pennsylvania by 5.0 percentage points, but it has an elasticity score of 0.94. Scores below one indicate that a state is more stubborn than average to shifting its vote.

If you divide Mr. Obama’s margin of victory by Pennsylvania’s elasticity rating, you come up with 5.4 percentage points. This may provide a more realistic guide to how much resistance a Republican faces in winning the state.

By contrast, although Mr. Obama leads in Iowa, Colorado and New Hampshire by slightly wider margins than in Pennsylvania, they each have above-average elasticity ratings, meaning that they contain a larger fraction of true swing voters than Pennsylvania does, and might revert to the center more easily. So they may still represent slightly easier targets for the next Republican nominee. Mr. Obama’s 5.6 percentage point margin in New Hampshire is equivalent to 4.4 percentage points after accounting for the state’s extreme “swinginess,” for instance.

Photo

By this measure, a Republican candidate’s path of least resistance runs not through either Pennsylvania or Colorado, but instead through New Hampshire. Winning it, along with Virginia, Ohio and Florida, would give a Republican 270 electoral votes, just enough to win.

Photo

That does not provide much margin for error. Virginia, for example, could become a problematic state for Republicans. Mr. Obama leads there by 3.9 percentage points, and it is also a relatively inelastic state. (Like Pennsylvania, Virginia contains some very Democratic and very Republican counties, but does not necessarily have all that many swing voters.) If Virginia becomes slightly Democratic-leaning, it could be a difficult state for Republicans to win back.

Of course, it is a bit ridiculous to apply this precise an analysis four years in advance of the next election.The relative order of the states will be affected by the identity of the Democratic and Republican candidates, and by the strategies they apply.

In a contest between Hillary Rodham Clinton as the Democratic nominee and Marco Rubio as the Republican nominee, for example, Pennsylvania might not figure so prominently. Mrs. Clinton performed very well in Pennsylvania in the Democratic primaries in 2008, while Mr. Rubio might give Republicans a better opportunity to win back states like Colorado and Nevada, which have a larger number of Hispanic voters.

But if the trends of the past few election cycles continue, and Democrats continue to make gains among minorities and with white voters that have high socioeconomic status, while Republicans perform strongly with working-class whites, then Pennsylvania could become more and more pivotal – and perhaps even essential to the Republican electoral math.

If so, it is a state that Republicans will want to concentrate on from the earliest stages of the campaign. And their nominee will need to build a robust turnout operation there, since the strategic imperative in inelastic states is not so much in persuading swing voters but in getting the party base to the polls.

This may particularly hold in Pennsylvania, where the messages that appeal to voters in the central and western portion of the state could turn off those in the Philadelphia suburbs. It’s not enough to persuade those voters, you also have to turn them out.

Democrats turn out a high percentage of their voters in Pennsylvania, and have won at least 2.9 million votes there in each of the past three elections. Republican performance peaked in 2004, when George W. Bush won almost 2.8 million votes. In a close national race, Republicans will need to identify and turn out another 200,000 voters or so to win the state.

It won’t be easy, but Pennsylvania has been getting closer to the electoral tipping point, and it represents a plausible path forward for Republicans.