Chapter 1 Introduction

This book is a collection of techniques and exercises using a dataset originated by Twitter to showcase some begginer techniques to analyze social phenomena and apply Computational Social Science concepts.

1.1 Motivation

The United States was selected as the focus of this study for several reasons:

  • The nation has a long-standing democratic tradition, coupled with a robust political culture, providing a stable context for political research.
  • The United States exhibits a significant presence on social media platforms, particularly Twitter, making it a relevant subject for digital political studies.
  • The pronounced political polarization at the time within the country presented an intriguing case for examining the dynamics of political communities.
  • Extensive literature exists on American politics and its intersection with social media, thereby facilitating the acquisition of pertinent information and enabling comparative analysis.

Twitter was chosen as the platform for data collection for the following reasons:

  • It is a social media platform at the time extensively utilized by politicians.
  • The platform’s open architecture allowed for straightforward data collection, thus making it a convenient choice for empirical research.

In 2022, Twitter experienced a transformative phase, largely instigated by its acquisition by Elon Musk12. The acquisition process commenced in April 2022 and culminated in October the same year, with Musk ascending to the role of the platform’s largest shareholder and subsequently its CEO34. Following the acquisition, the organization underwent a rebranding to X Corp. and executed a significant downsizing of its workforce while introducing a series of reforms5. Public and scholarly opinion on these changes has been ambivalent, with some lauding Musk’s strategic vision and others expressing apprehensions about possible increases in misinformation on the platform6.

A subsequent critical development occurred in February 2023 when Twitter terminated complimentary access to its Application Programming Interface (API)7. This policy shift has elicited substantial debate, notably among academic researchers who have historically utilized Twitter’s API for computational studies in social media8. The introduction of a tiered pricing strategy for API access has exacerbated these concerns, raising questions about the feasibility of the new cost structure for academic research and its apparent orientation toward corporate clientele9.

In light of these developments, it is noteworthy that the present research relies on Twitter data that, due to recent policy changes, is no longer freely accessible. The cessation of free access to Twitter’s API in February 2023 has significant implications for the reproducibility and extension of this study10. Given that Twitter’s API has been a cornerstone for academic research in computational social sciences, this policy shift poses challenges not only for data collection but also for the broader scholarly community interested in similar inquiries11.

The newly introduced tiered pricing model for API access could impose financial constraints on academic researchers, thereby potentially skewing the research landscape in favor of corporate interests12. We reject this approach and consider it in direct violation of the Digital Service Act, in addition of being an example of inconsiderate management of digital platforms.

1.2 Objectives

The primary aim of this research is to provide an in-depth analysis of the U.S. political landscape as it manifested on the Twitter platform in 2020. The study is guided by three overarching research questions:

  1. The first question seeks to unravel the organizational architecture of the political community in the United States on Twitter. This question delves into how politicians, political organizations, and affiliated entities are interconnected in this digital sphere.

  2. The second question focuses on the interactional dynamics among politicians on Twitter. Here, the research aims to scrutinize the nature, frequency, and context of interactions that U.S. politicians directly engage with each other through the Twitter platform.

  3. Lastly, the third question aims to outline the distinctive characteristics of the U.S. political community on Twitter. This encompasses elements such as dominant themes, rhetorical strategies, and the overall tone and tenor of political discourse.

By exploring these research questions, the study aims to contribute to the existing body of knowledge on digital political ecosystems.

1.3 Methodology

This research aims to perform an exhaustive network analysis among the selected accounts contained in the uspolitician2020 dataset. This dataset covers the years 2019-2020 and contains various attributes of U.S. politicians Twitter accounts, such as name, screen name, class, and role. The analytical approach involves calculating multiple network metrics including degree measures, centrality indices, and reciprocity. Additional structural metrics such as assortativity, homophily, and dyadicity are also assessed to understand the underlying structure and tendencies in the network.

Specific R packages geared towards network analysis are employed for data manipulation and evaluation. Preprocessing steps are in place to ensure data validity, involving the handling of missing values and data type conversions. The research is limited by its dataset, which is constrained to the years 2019-2020 and may not represent dynamic changes in the network structure beyond this period.

1.4 Acknowledgements

I would like to thank professor Christopher Bail and the Venice International University for the university project that inspired this research.

1.5 License

This book is licensed under the Creative Commons Attribution 4.0 International License.


  1. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  2. CNN, “Twitter confirms completion of Elon Musk’s $44 billion acquisition deal,” CNN, accessed on 9/13/2023.↩︎

  3. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  4. CNN, “Twitter confirms completion of Elon Musk’s $44 billion acquisition deal,” CNN, accessed on 9/13/2023.↩︎

  5. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  6. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  7. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  8. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  9. Wikipedia, “Acquisition of Twitter by Elon Musk,” Wikipedia, accessed on 9/13/2023.↩︎

  10. Nature, “Researchers scramble as Twitter plans to end free data access,” Nature, accessed on 9/13/2023.↩︎

  11. Nature, “Researchers scramble as Twitter plans to end free data access,” Nature, accessed on 9/13/2023.↩︎

  12. Nature, “Researchers scramble as Twitter plans to end free data access,” Nature, accessed on 9/13/2023.↩︎