Alan Ding: using data science to probe political polarization on Twitter

Monday, Jul 26, 2021
by Sharon Adarlo

Alan Ding, 21, Class of 2022 


Ding is a computer science major and is in the process of completing the undergraduate certificate program at the Center for Statistics and Machine Learning (CSML).


In his independent project for the CSML certificate, Ding decided to look into the deeply polarizing COVID-19 discourse on Twitter. He wanted to analyze any trends and see if it was possible to ameliorate polarization on the social media platform.

“In this study, I used Twitter data to identify groups of users that potentially wield a large amount of influence over public opinions, calculate metrics that quantify the sentiment and polarity of tweets sent out by different groups of users, and conduct regression analysis in order to determine which groups of users have sentiment and polarity most strongly predictive of the sentiment and polarity of general Twitter discourse,” Ding said.

Ding analyzed tweets spanning from March 22, 2020 to November 17, 2020. His dataset contained 38,674,878 tweets in English that were all plausibly from the United States. He divided users into different camps such as celebrities, politicians and media personalities. 

While many of the regressions failed to pick up on any significant trends, Ding did uncover a few interesting finds: when looking only at tweets relating to COVID-19 cases and death statistics or Tweets discussing the severity of the pandemic, respectively, the polarity or sentiment of tweets from celebrities on Twitter, and to a lesser extent, media personalities, were the strongest predictors of public polarity or sentiment.

Ding enjoyed the research project and found that it enhanced his burgeoning skillset in wrangling data.

“This was the first research undertaking, at least of this size and scope, I've ever taken on. It was also basically the first where I was able to apply a lot of the knowledge that I learned in class, such as my CSML courses,” he said. “I had the chance to get my hands dirty so that was fun.”

Ding also undertook a second independent work project last spring relating to legislative redistricting in Ohio, his home state. Specifically, he looked at the partisan outcomes of several collections of algorithmically-generated districting plans with different criteria on the districts’ racial representativeness.

After he graduates, Ding is leaving as many doors open as he can, considering options in academia, industry, or non-profit work. No matter where he may go next, Ding thinks he will be using the skills he learned during the CSML program.

I think that a lot of the knowledge that I've gained from taking classes in CSML has been very broadly applicable,” he said. “Many of my intellectual interests leverage data science, whether I’m using it to analyze my runs or to combat gerrymandering.”

This summer, Ding is an undergraduate summer fellow at the Center for Digital Humanities and a software engineer intern at Microsoft. 

Extracurricular Activities:

Ding is part of the Princeton Running Club and plays the saxophone with the Princeton University Wind Ensemble. He is also part of the Princeton Undergraduate Composers Collective, which is devoted to music composition.

For Fun:

Ding enjoys running, composing music, and playing and performing music, including on the piano.