Roy Moore, who has been accused by two women of initiating unwanted sexual contact with them when they were underaged, is back in the lead in the most recent polls of Alabama’s Senate race. Although it’s still anyone’s election — turnout is hard to model in special elections and Moore’s lead is narrow — he has to be considered at least a modest favorite.

If Moore wins, you’re liable to see a lot of commentary along the lines of what the notoriously corrupt Democratic Gov. Edwin Edwards said when seeking to regain Louisiana’s governorship in 1983: “The only way I can lose this election is if I’m caught in bed with either a dead girl or a live boy.” (Edwards won by 26 percentage points.) Or, if you prefer a more recent example, what President Trump said about his political base in 2016: “I could stand in the middle of Fifth Avenue and shoot somebody and I wouldn’t lose voters.” That is to say, a Moore win would be taken as a canonical example of how politicians can get away with almost anything — even allegedly molesting two teenage girls — and still win elections so long as their base remains loyal to them.

The truth is a little more complicated than that. Moore — even if he wins by a few points — will have vastly underperformed a typical Republican in Alabama. He’ll have benefitted from running in a highly partisan epoch in a deeply red state and from drawing an opponent in Democrat Doug Jones who has fairly liberal policy views, including on abortion. If Alabama were just slightly less red — say, if it were South Carolina or Texas instead — Jones would be on track to win, perhaps by a comfortable margin. In Alabama, he’s an underdog. Nonetheless, the marginal effect of the allegations and of Moore’s other controversies may be fairly large.

It’s really hard for a Democrat to win in Alabama

Alabama has been an extremely red state since the demise of the Solid South. Moreover, it’s been consistently red; unlike states such as West Virginia, where Democrats are sometimes viable in races for local office and for Congress, Alabama has been voting Republican for pretty much everything. There are currently no Democrats who hold statewide office in Alabama. With one exception, all members of the state’s Congressional delegation are Republicans. And in recent elections for president, Congress and governor, the Republican candidate has won by an average of about 30 percentage points.

Alabama is really, really red Republican margin of victory or defeat in recent elections STATE GOVERNOR HOUSE PRESIDENT SENATE AVERAGE Wyoming +37.4 +40.9 +43.6 +54.4 +44.1 Utah +37.0 +31.3 +32.9 +38.2 +34.8 Oklahoma +17.8 +41.9 +35.0 +40.5 +33.8 North Dakota +43.0 +25.2 +27.7 +30.3 +31.5 Tennessee +39.7 +24.8 +23.2 +32.2 +30.0 ➔ Alabama +21.5 +27.9 +25.0 +44.0 +29.6 Idaho +20.6 +30.9 +31.7 +34.5 +29.4 South Dakota +34.0 +25.4 +23.9 +32.3 +28.9 Nebraska +32.9 +30.2 +23.4 +24.2 +27.7 Kansas +17.4 +33.9 +21.0 +29.9 +25.6 Louisiana +17.8 +34.8 +18.4 +16.6 +21.9 Mississippi +28.1 +18.7 +14.6 +19.3 +20.2 Arkansas -8.4 +35.6 +25.3 +20.3 +18.2 Kentucky -5.9 +27.8 +26.3 +15.0 +15.8 South Carolina +9.5 +20.1 +12.4 +21.0 +15.7 Texas +16.5 +12.5 +12.4 +21.5 +15.7 Alaska +21.4 +19.9 +14.4 +2.1 +14.4 West Virginia -4.7 +21.8 +34.2 +1.8 +13.3 Georgia +9.0 +15.3 +6.4 +10.7 +10.4 Iowa +15.7 +4.7 +1.8 +16.4 +9.6 Ohio +16.3 +11.2 +2.5 +7.4 +9.4 Indiana +4.5 +14.2 +14.6 +2.0 +8.8 Montana -2.7 +13.7 +16.9 +7.0 +8.7 Arizona +11.8 +5.6 +6.3 +8.0 +7.9 Maine +11.9 -12.8 -9.1 +37.0 +6.7 Nevada +29.2 +1.5 -4.5 -0.6 +6.4 Missouri -3.3 +18.1 +13.9 -6.5 +5.6 North Carolina +5.6 +4.8 +2.8 +3.6 +4.2 Florida +1.1 +6.3 +0.2 -2.7 +1.2 Wisconsin +5.7 +0.2 -3.1 -1.1 +0.4 Pennsylvania -0.4 +4.8 -2.3 -3.8 -0.5 Colorado -3.3 +2.9 -5.1 -1.9 -1.9 Virginia -5.7 +5.1 -4.6 -3.4 -2.1 New Hampshire -5.6 -3.5 -3.0 -1.7 -3.4 Michigan +11.1 -3.3 -4.6 -17.0 -3.4 New Mexico +10.6 -7.5 -9.2 -8.4 -3.6 Minnesota -3.0 -7.0 -4.6 -22.5 -9.3 Illinois +1.5 -10.1 -16.9 -13.0 -9.6 New Jersey +4.0 -12.5 -15.9 -16.5 -10.2 Washington -5.9 -5.8 -15.2 -19.4 -11.6 Oregon -4.8 -13.7 -11.5 -21.1 -12.8 Connecticut -1.6 -25.9 -15.5 -20.2 -15.8 Rhode Island +3.0 -22.2 -21.5 -35.6 -19.1 Maryland -5.3 -24.5 -26.2 -27.4 -20.9 Massachusetts -2.3 -45.3 -25.2 -15.7 -22.1 Delaware -30.0 -22.7 -15.0 -25.5 -23.3 California -16.4 -21.6 -26.5 -42.5 -26.8 Vermont -3.6 -47.4 -31.0 -28.2 -27.6 New York -21.6 -26.7 -25.3 -44.6 -29.6 Hawaii -14.7 -41.0 -37.4 -39.5 -33.2 Based on an average of gubernatorial elections since 2010, and Senate, House and presidential elections since 2012. Races that were uncontested by one of the major parties are treated as 60-point victories. Races that were contested but where a third-party candidate finished first or second are not included in the average. Source: Dave Leip’s U.S. Election Atlas, David Wasserman

And in some ways this understates the GOP advantage, because as The Upshot’s Nate Cohn points out, Alabama is not only a red state but also a highly inelastic state. What that means is there aren’t very many swing voters there: Around 50 percent of the state’s electorate are white evangelicals, the most reliable Republican voting bloc, while another 25 percent or so consists of black voters, the most reliable Democratic voting bloc. In elastic states, the identity of the candidates can matter a lot; for instance, while North Dakota (a relatively elastic state) is about as Republican as Alabama on average, its results vary a lot from election to election — so Democrat Heidi Heitkamp won the state’s U.S. Senate race by 1 percentage point in 2012, while Republican John Hoeven won its 2016 Senate race by 62 points. Alabama isn’t like that; the results are usually about the same regardless of the candidates.

So the fact that Jones is running within a couple percentage points of Moore is itself pretty remarkable: Moore is performing around 25 points worse than Republicans ordinarily do in Alabama despite there being few swing voters in the state.

Not all of that can be attributed to the recent allegations against Moore, however. He was leading by an average of “only” about 10 points in polls conducted before the allegations surfaced, although there was a lot of variation from survey to survey. (And Moore won by just 4 points the last time he was on a general election ballot in Alabama, in a race to become the chief justice of the Alabama Supreme Court in 2012.) Plus, the national political environment is good for Democrats and poor for Republicans. The allegations have had a fairly clear effect on the polls — even if some of it is fading now. But they might have had a larger effect if so many Alabamians who usually vote Republican weren’t already set against Moore for other reasons, such as his having been removed twice from the state’s supreme court.

Overall, the effects of the scandal seem to be of roughly the same magnitude as those identified in a 2011 paper by Nicholas Chad Long, who found that scandals involving “immoral behavior” hurt incumbent U.S. senators by a net of about 13 percentage points, controlling for their past margin of victory and other factors.

But shouldn’t the effects be larger than that, given that the conduct Moore is accused of is so egregious? Well, maybe, but the problem is that a lot of voters don’t believe the allegations. A poll this week from Change Research found that only a 42 percent plurality of Alabamians believed Moore’s accusers, compared with 38 percent who disbelieved them. And Trump voters disbelieved them by a 63-9 margin.

One needs to be careful here, because the line between “don’t believe the allegations” and “wouldn’t vote for a Democrat under any circumstances” can be blurry — voters may say they disbelieve the allegations as a way of rationalizing their vote for Moore. Nonetheless, if you’re someone who worries about what sort of precedent Moore’s election would set, the better reason for concern is that Moore seems to have successfully persuaded some Alabamians that the allegations against him are a conspiracy put together by liberals, gay people and the news media. In an era where trust in the news media is extremely low among Republicans, that’s a strategy that other scandal-plagued Republicans are liable to emulate — and, of course, it’s one borrowed from President Trump’s playbook.

In many other respects, though, this isn’t anything new. Long’s paper found that while scandals can have reasonably large effects at the margin, two-thirds of scandal-plagued incumbents nonetheless won re-election to the U.S. Senate between 1974 and 2008.

And candidates are more likely to survive scandals in extremely red or extremely blue states. Just ask Gov. Edwards, whose resilience in the face of scandal was partly a matter of his political talent — but perhaps had more to do with the fact that Louisiana had just one Republican governor in the 118-year period between 1877 and 1995. In the current political climate, a Democrat getting elected in Alabama may similarly be a once-a-century type of event.