Before the November 8 presidential vote, nearly all pollsters were convinced Hillary Clinton would win.

New York, United States – To borrow a phrase from US president-elect Donald Trump, the pollsters were wrong, “big league”.

Before the November 8 presidential vote, the Republican candidate was some 4 percentage points behind his Democratic rival, Hillary Clinton, according to the last pre-election poll by Fox News, a right-leaning network, and others.

The RealClearPolitics website, which aggregates polls, consistently put Clinton ahead of the businessman.

The FiveThirtyEight site of Nate Silver, a venerated pollster, gave Clinton a 71.4 percent chance of sauntering back into the White House in January 2017.

The New York Times’ Upshot gave Trump even worse odds on becoming the 45th president.

But, reminiscent of Britain’s Brexit vote in June and Colombia’s peace-deal snub in October, Americans had other plans with many more voters backing the anti-establishment candidate than pollsters foresaw.

Trump had secured momentous upset victories in Florida, North Carolina, Pennsylvania and Wisconsin – critical battleground states where most public polls and private projections had put Clinton ahead.

As analysts tried to work out what a Trump presidency means for the world economy, trade deals, immigration and even the war in Syria, number crunchers went back to their spreadsheets to assess where the data models went wrong.

‘Brexit effect’

“There was indeed a Brexit effect,” Allan Rivlin, of Zen Political Research, a consultancy, told Al Jazeera.

“There were un-modelled Trump voters. If you had asked them, they would have happily told you they were supporting Trump. But nobody asked them because they weren’t in the model because they hadn’t voted in recent elections.”

Pollsters survey for two basic variables – the demographic make-up of voters, and how each sub-group is expected to ballot.

Some groups, such as young black men, are less likely to vote than others, such as old white women. Pollsters attach different weight to various categories and, according to Rivlin, they under-valued whites who had not voted in recent elections.

Trump’s surprise victories were in states with declining industries, such as Pennsylvania and Wisconsin, where pollsters underestimated how many disaffected whites would vote because of their track record in skipping polling days, he added.

“There were more Republican voters in the key states and Republicans did a better job of identifying those key states,” Rivlin said.

“There was a failure of imagination on the part of the Democrats to see the anger at Washington and economic discontent among white working-class voters in the suburbs and exurbs of the Great Lakes states.”

‘Hidden’ Trump voters

Some analysts point to other “hidden” Trump voters who were embarrassed to admit support for the truculent property magnate when speaking with flesh-and-blood pollsters, as opposed to the automated systems used by some firms.

The Los Angeles Times/University of Southern California tracking poll consistently pegged Trump as the leader throughout the final months of the campaign. Many rival pollsters derided its seemingly out-of-step forecast.

That poll is based on an internet survey rather than a telephone questionnaire. It may have been more accurate because online respondents were more likely to reveal their support for Trump than when speaking with a human.

This raises other issues about data-collection. Polls vary in many ways and differ in their sample sizes and whether respondents are randomly selected from telephone directories or pulled from voter rolls from previous elections.

Even conducting surveys via mobile phones, as opposed to land lines, can skew results.

“All polls are not equal. They don’t use the same methodology. Using robo-calls as opposed to human beings is faster and easier and you get a lot more bang for your buck,” Peter Brown assistant director of Quinnipiac University Poll, told Al Jazeera. “Some are better than others.”

Badly run and misleading polling firms may create false impressions, said Brown.

“Tell me, do you know who these organisations are. Have you heard of them? Have you dealt with them? Do you know their backgrounds? Are they part of a political consulting firm that works either for one party or the other?” asked Brown.

As results came in, FiveThirtyEight’s Jody Avirgan spoke of the need to “piece together what we know about this big, complicated moment in American history”. A post mortem is expected later.

In The New York Times, media columnist Jim Rutenberg acknowledged that “something was fundamentally broken in journalism” and probed whether the media had been too cosy with Clinton’s camp.

Popular vote for Clinton

While pollsters got the outcome wrong, they may not have been too far off, said Matt Barreto, cofounder of polling firm Latino Decisions. Clinton is still on track to win the popular national vote and secured big margins in such populous states as California and New York.

Some ballots have yet to be counted, but Clinton’s 59.7 million votes amounted to 48 percent of the popular vote, compared to Trump’s 59.5 million (47 percent). In the Electoral College that determines the winner, however, Trump’s 279 votes beats Clinton’s 228 current tally.

But Trump turned out a small yet decisive number of “disaffected white voters in small pockets of a few swing states” like Florida, North Carolina and Wisconsin that pushed him above the 270 Electoral College votes needed to win, he added.

“The states that he won, he did not win by a lot,” Barreto said.

Trump has his own theories. Before polling day, he said pollsters did a bad job and released “phony numbers”. In his acceptance speech in the early hours of Wednesday, he praised the groundswell of popular support that carried him to victory.

“Ours was not a campaign, but rather an incredible and great movement made up of millions of hard-working men and women who love their country and want a better, brighter future for themselves and for their families,” he told the crowd in New York.