Social media is a scary place for Democrats right now.

The polls have favoured Hillary Clinton for months. Experts have begun discussing her cabinet choices. Pundits have been wondering by just how much Donald Trump will lose. (How big will the landslide be? How severe the repudiation of his public persona?)

But after an analysis of social media data, using a crowd-integrated, sentiment-driven research approach, we have seen a possible shock arising in the conclusion of this unprecedentedly rancourous US election.

Positive sentiment is soaring for Trump nationwide. That is correct: Donald Trump is crushing it online, and there is only a matter of days before election day on 8 November.

Even worse for Clinton, in terms of the realities of the US electoral system, her social media sentiment is under water in 10 of the 11 of the key swing states:

Despite largely being written off over the past month — this followed a slew of bad press regarding his treatment of women — our analysis of the fundamentals of the race after the first debate has been largely vindicated.

Those fundamentals were six in number and revolved around the fact that Clinton’s high negative sentiment (only bested in polling history by Trump himself) meant that she was simply unable to absorb moderate Republicans who were disenchanted with their uncouth candidate.

This, along with Trump’s residual strength in some important states, meant that despite his gaffes and controversies, the underlying structure of this election was always going to make for a close race.

In short, no matter the popular vote, so long as Trump remains in touch, holds the states previous Republican candidate Mitt Romney won last election (not a complete guarantee), to win he simply needs to take Ohio, Florida and a combination of other, smaller states from the Democratic column from 2012.

In those two crucial states during the month of October, Trump currently holds significant margins over Clinton in positive sentiment on social media — as well as in a battleground state such as Michigan, which is meant to form part of Clinton’s “firewall” of states out of Trump’s reach:

Of course, this must still be taken with a pinch of salt. This race has always been volatile, particularly in the social media data, as US voters deal with the angst of putting one of two unpopular public figures into the world’s most powerful office. And no statistical projection is a sure thing. Social media analysis does tend to exaggerate (and also pre-empt) the polling.

But at the very least, a President Trump is by no means out of the question.

So how has Trump, despite losing one news cycle after another, managed to roar back into contention?

It seems as though his negatives may have been “baked in” to voters’ appraisal of him. His skeletons probably came as no surprise to many, and, as an outsider figure, he has always had a high threshold in terms of the leeway the public has given him. It perhaps serves to remind the electorate that he is indeed not a polished and consultant-coached politician.

Meanwhile, last Friday Clinton’s identity as the ultimate insider candidate returned to the foreground of voters’ minds as FBI director James Comey announced that new evidence was being assessed with regard to the investigation into whether she mishandled classified information by using a home server for official e-mail.

Even worse for Clinton, this new evidence was discovered in a separate FBI investigation of her closest aide’s estranged husband, disgraced former congressman Anthony Weiner, for allegedly sending lewd messages to a minor. It appears that somehow official e-mails emanating from Clinton’s office while she was secretary of state may have found their way onto Weiner’s devices. This is not the press a candidate is hoping for in the final week of an election, and it has sent wavering Republicans back into the arms of Trump.

And because Trump was never as intensely disliked in the US as suggested by a media establishment which abhors him, this has also given him an opportunity to solidify his status as an anti-establishment candidate ready to torch the old Clinton/Bush style of politics which has dominated Washington DC for close to 30 years. In a populist age, this is a real asset.

To summarise, the momentum is with Trump.

There is also anecdotal evidence from social media to support this. There is talk of widespread mistrust in the traditional polls showing Trump behind, “Trump towns” covered with his banners, and huge audiences for his rallies.

The big question of course is why this shocking social media data does not seem to be reflecting in the traditional polls. There are a few possible solutions to the riddle. First of all, one should remember the polls failed to call Brexit. Polling after all is not freely volunteered information.

There can be no doubt that Clinton is in some degree of trouble — and that Trump is on the move

Secondly, there may simply be a time lag between voter shifts as recorded on social media in real time, as opposed to polls which are collated over time using phone surveys. Even Google’s Consumer Surveys have tended to lag behind social media sentiment.

Thirdly, there is also the fact that Clinton’s slender advantage in many national polls could be misleading. This is because Clinton is doing well in states she will likely still lose — such as Texas, Georgia and South Carolina. Running higher than normal Democratic numbers in states she does not win gives her no advantage in the Electoral College.

And finally, it is also possible that social media is reflecting the voices of highly enthusiastic activists and partisans, and quieter Hillary supporters, finding their voice in the upcoming days, tip the election for her on Tuesday, with her superior campaign organisation and “ground game” providing the finishing touches.

There is also the often-ignored fact that many states have been voting for some time — a Trump push on election day might not be enough to overturn Clinton’s prior advantage in sentiment.

Already, the latest raw social media data is beginning to balance last week’s massive swing to Trump — with Pennsylvania seeming to swing dramatically back toward Clinton. Ultimately, in this year’s election season, no conclusion is certain until the votes are cast (and even then a tie or dead-locked Electoral College could send the decision to the newly elected congress).

That said, one has to remember that the above data represents information freely volunteered online, in a developed nation with a high degree of social media market penetration.

In short, there can be no doubt that Clinton is in some degree of trouble — and that Trump is on the move.