Polling in the New Hampshire presidential primary accurately forecast victories by Republican Donald Trump and Democrat Bernie Sanders, a reversal from earlier this month when surveys failed to predict voters’ behavior in the Iowa caucuses.

In the days before Tuesday’s primary, some polls also correctly showed Ohio Governor John Kasich, who came in second, narrowly beating the rest of the Republican pack.

The accurate calls were especially significant because New Hampshire’s primary is a famously tough to project, as shown in 2008 when Democratic candidate Hillary Clinton defied polls and beat her opponent, Barack Obama. 

In this year’s contest, polling companies grappled with an electorate that said it hadn’t settled on a candidate in the days before voting began, as well as a Republican field featuring both an unorthodox outsider in real-estate mogul Trump and multiple candidates vying for the state’s establishment vote. Those difficulties were compounded by a Saturday Republican debate that may have changed voter sentiment.

Yet some factors may have improved the accuracy of the surveys, including a snow storm and Sunday’s Super Bowl. Both events may have kept residents indoors, making them more likely to answer calls from pollsters, increasing the reliability of the results.

Getting ‘Lucky’

“With New Hampshire, I’m pretty much convinced that if you get it right, you might just be lucky,” said Andrew Smith, the director of the University of New Hampshire Survey Center in Durham.

Polls headed into Tuesday showed Trump and Sanders, a Vermont senator, as distinct favorites. The RealClearPolitics average of six polls completed in the three days before the election gave Trump a 17 point lead over the rest of the Republican field, while Sanders held a 13 point advantage over Clinton, the former secretary of state. With more than 80 percent of the precincts reporting, those advantages largely held: Trump topped Kasich 35 percent to 16 percent, and Sanders beat Clinton 60 percent to 39 percent, according to the Associated Press.

Rubio Plunge

In the race for second place among Republicans, three of the polls showed Kasich as Trump’s top competitor. Another three showed other candidates in second place. All six showed Kasich, Senators Ted Cruz of Texas and Marco Rubio of Florida, New Jersey Governor Chris Christie and former Florida Governor Jeb Bush within the margin of error of one another.

The polling didn’t completely capture Rubio’s plunge from a strong third place in Iowa to fifth in New Hampshire. None of the recent polls showed him coming in worse than fourth place. The final surveys before the primary were already under way when Christie sharply attacked Rubio in the Saturday debate, meaning the polls may not have been able to fully detect how much support that criticism cost the candidate.

“Pollsters fear something important is going to happen in the middle of their poll,” said Ken Goldstein, a professor of politics at the University of San Francisco who analyzes polling and advertising for Bloomberg Politics. “Something potentially important happened here in terms of the debate.”

Iowa Inaccuracies

Polling companies faced questions about inaccurate predictions in the Feb. 1 Iowa caucuses, where Cruz surged past Trump for a decisive win, and Clinton barely eked out victory despite final polls showing her with a clear lead. Iowa joined misfires in major races overseas in the past year -- including Israel, Greece, and the U.K. -- eroding public trust in polls.

“Polling in New Hampshire -- even though we’ve had some surprises in the past -- is easier” than in Iowa, said Joshua Dyck, a professor of political science at the University of Massachusetts at Lowell.

Iowa’s unique caucus system -- residents show up at a set time and spend hours debating candidates with their neighbors -- means turnout is lower than in New Hampshire, the first primary in the nation. When turnout is lower, results are harder to predict because polling companies have to determine who is likely to show up to cast ballots, Dyck said.

Iowa doesn’t provide many clues to polling companies about voter behavior. Aside from significant differences in turnout, the states have radically different demographics, and in New Hampshire, independents can vote across party lines.

Changed Electorate

The New Hampshire electorate has also changed dramatically from the state’s last competitive races, adding another wild card for polling companies that seek to increase reliability by relying on past voting records. As many as 30 percent of the potential voters this year weren’t eligible to vote in 2008, either because they lived in another state or weren’t old enough to vote, according to University of New Hampshire study.

Many of the state’s 1.3 million residents may be suffering polling fatigue, which polling specialists said they feared could skew results. At least 10 different media organizations or partnerships polled the state in February alone, with some conducting daily tracking surveys.

“New Hampshire voters have been so over-called at this point, both through polling and especially through increasingly aggressive contact by campaigns and interest groups, it is reasonable to wonder about the potential effects of survey response rates," said Deborah Brooks, a government professor at Dartmouth College in Hanover, New Hampshire.

Before it's here, it's on the Bloomberg Terminal. LEARN MORE