Abstract
A sentiment analysis of 5051 Twitter posts from January 2022 found that 53.4% of them expressed positive views on ivermectin as a COVID-19 treatment, 35.6% of them were neutral, and 11% of them were negative, highlighting the polarized public perception and the need for careful interpretation of social media data in health communication.
Keywords: COVID-19, ivermectin, sentiment analysis, Twitter, social media, public health, misinformation, geolocation analysis
Introduction
As the COVID-19 pandemic evolves, the scientific community confronts the limitations of vaccines due to emerging viral mutations that potentially decrease vaccine efficacy [1], thus necessitating a parallel investigation into additional therapeutic agents. Ivermectin, a well-established, safe drug, has emerged as a repurposed drug candidate due to preliminary studies suggesting its antiviral properties against SARS-CoV-2 in vitro [1,2]. Nonetheless, the scientific debate remains vigorous, with discussions on the drug’s appropriate formulation and dosing for potential COVID-19 prophylaxis and treatment [3].
Simultaneously, ivermectin’s role has garnered widespread attention on social media, reflecting the public's quest for alternative treatments. Twitter (now X), a hub for real-time public discourse, has become a fertile ground for divergent views on COVID-19 treatment [4,5]. This sentiment analysis focuses on Twitter discussions about ivermectin, showing public opinion that, while not devoid of misinformation risks, these discussions offer an alternative lens to understand the societal pulse on this contentious topic [6]. By examining the sentiments expressed on Twitter, we aim to add nuance to the ongoing discourse, acknowledging the platform's influence on public perception and its implications for health communication strategies.
Methods
Overview
This cross-sectional examined the COVID-19–related sentiments on ivermectin using Twitter data. Primary data were collected from Twitter posts about ivermectin worldwide from January 15 to 22, 2022. We searched posts with the keyword “ivermectin” and retrieved raw data with various variables. Data cleaning involved lowercasing capital letters, eliminating retweet symbols, removing punctuation marks, and other preprocessing steps to ensure data accuracy [6]. People’s sentiments were determined by creating a corpus (body of text) and loading a lexicon dictionary based on the positive and negative words. The sentiment score was calculated with the Bing method using a range of –6 to +6 and considered 3 sentiment types: positive, neutral, and negative [7,8]. The Bing lexicon was chosen for its proven effectiveness and simplicity in extensive dataset analysis. Frequency analysis of single terms (unigrams), word pairs (bigrams), and bigram networks helped identify frequently mentioned terms and explore relationships between words [7,8]. Despite its simplicity, this approach is as robust as more complex methods, as it accurately categorizes sentiments and identifies patterns through unigram and bigram frequency analysis [6]. This computational analysis–focused methodology offers valuable insights into public sentiment, complementing traditional clinical evaluation without extensive statistical validation. Data were mined using Twitter’s limited application programming interface (version 2) and analyzed using RStudio (R Foundation) and relevant packages for visualization.
Ethical Considerations
There was no direct connection with Twitter users. We removed all individual data, usernames, IDs, and tweets in the manuscript and supporting material. Therefore, ethical approval was not required.
Results
In total, 5051 ivermectin-related tweets underwent sentiment analysis, revealing a prevailing positive sentiment (53.4%), followed by neutral (35.6%) and negative (11%) sentiments among the analyzed tweets (Figure 1). The analysis identified frequently mentioned positive terms such as “medication,” “potentially,” and “treatment,” while negative terms like “poised,” “smuggling,” and “toxic” were less common. Notably, analysis of word pairings unveiled strong associations with positive sentiments, further supporting the notion of ivermectin’s potential efficacy in COVID-19 treatment. Examining these word pairings facilitated in-depth exploration of sentiment patterns within the bigram network, revealing significant connections and relationships in the analyzed tweets (Figure 2).
Figure 1.

Distribution of sentiment score.
Figure 2.

Bigram count network related to tweets ivermectin.
Discussion
Principal Findings
Our analysis shows that tweets about repurposing ivermectin for COVID-19 treatment are predominantly positive. Terms like “medication,” “potentially,” and “treatment” frequently appeared in positive contexts, reinforcing this finding. Phrases such as “ivermectin works,” “available ivermectin,” and “ivermectin medication” were strongly associated with positive sentiment. These results align with previous findings showing ivermectin’s popularity on Twitter for COVID-19 treatment [4,5]. However, some negative sentiment was observed, particularly concerning warnings from the Food and Drug Administration and the limited clinical evidence supporting ivermectin’s efficacy in COVID-19 prevention and treatment [9].
Twitter data have proven valuable in monitoring public responses to the COVID-19 pandemic, as evidenced by a study of millions of SARS-CoV-2–related tweets [10]. This study not only identified dominant topics like new cases, death rates, and preventive measures, but also explored the geographic distribution of sentiments through tweet-embedded geolocation data (code available in Multimedia Appendix 1).
Limitations
Of note, the findings are based on Twitter data, which may not represent the entire population’s sentiments. Therefore, researchers conducted cross-validation of the sources.
Conclusions
This sentiment analysis highlights the polarized perception of ivermectin in COVID-19–related discourse and reflects broader public health debates. Given the regulatory advisories and the limited clinical evidence, these public sentiments must be interpreted cautiously.
Acknowledgments
We acknowledge receiving the Ministry of Higher Education, Science, and Technology Overseas Postgraduate Education scholarship (DIKTI BPP-LN grant T/915/D3.2/KD.02.01/2019) awarded to AK. Despite this financial support, we have diligently maintained transparency and objectivity in our work.
Code in R.
Footnotes
Conflicts of Interest: None declared.
References
- 1.Jiang S. Don't rush to deploy COVID-19 vaccines and drugs without sufficient safety guarantees. Nature. 2020 Mar 16;579(7799):321–321. doi: 10.1038/d41586-020-00751-9.10.1038/d41586-020-00751-9 [DOI] [PubMed] [Google Scholar]
- 2.Caly Leon, Druce Julian D, Catton Mike G, Jans David A, Wagstaff Kylie M. The FDA-approved drug ivermectin inhibits the replication of SARS-CoV-2 in vitro. Antiviral Res. 2020 Jun;178:104787. doi: 10.1016/j.antiviral.2020.104787. https://linkinghub.elsevier.com/retrieve/pii/S0166-3542(20)30201-1 .S0166-3542(20)30201-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.The WP. NIH trial may settle debate over ivermectin as a covid-19 treatment. The Washington Post. [2023-03-06]. https://www.washingtonpost.com/health/2021/04/08/ivermectin-covid-drug/
- 4.de Melo T, Figueiredo CMS. Comparing news articles and tweets about COVID-19 in Brazil: sentiment analysis and topic modeling approach. JMIR Public Health Surveill. 2021 Feb 10;7(2):e24585. doi: 10.2196/24585. https://publichealth.jmir.org/2021/2/e24585/ v7i2e24585 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Garcia K, Berton L. Topic detection and sentiment analysis in Twitter content related to COVID-19 from Brazil and the USA. Appl Soft Comput. 2021 Mar;101:107057. doi: 10.1016/j.asoc.2020.107057. https://europepmc.org/abstract/MED/33519326 .S1568-4946(20)30995-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Hill S, Scott R. Developing an Approach to Harvesting, Cleaning, and Analyzing Data from Twitter Using R. Inf Sys Educ J. 2017;15(3):15. [Google Scholar]
- 7.Liu B, Hu M, Cheng J. Opinion observer: analyzing and comparing opinions on the Web. WWW '05: Proceedings of the 14th international conference on World Wide Web; May 10-14, 2005; Chiba, Japan. 2005. pp. 342–351. [DOI] [Google Scholar]
- 8.Liu B. Sentiment Analysis: Mining Opinions, Sentiments, and Emotions. Cambridge, United Kingdom: Cambridge University Press; 2020. [Google Scholar]
- 9.Why You Should Not Use Ivermectin to Treat or Prevent COVID-19. Food and Drug Administration. [2022-03-01]. https://nycourts.gov/reporter/webdocs/Why-You-Should-Not-Use-Ivermectin-to-Treat-or-Prevent-COVID-19.pdf .
- 10.Xue J, Chen J, Hu R, Chen C, Zheng C, Su Y, Zhu T. Twitter discussions and emotions about the COVID-19 pandemic: machine learning approach. J Med Internet Res. 2020 Nov 25;22(11):e20550. doi: 10.2196/20550. https://www.jmir.org/2020/11/e20550/ v22i11e20550 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Code in R.
