STASH, Vol. 13(11) – #NotHowThatDrugShouldBeUsed: Tweets on nonmedical use of prescription drugs


Recently, computer scientists have been developing algorithms for sifting through social media feeds and searching key terms and topics to predict diverse outcomes related to the stock market, shopping habits, depression, and more. This week’s STASH reviews surveillance of Twitter traffic by Janani Kalyanam and her colleagues. They searched millions of tweets for references to nonmedical use of prescription drugs.

What was the research question?

Is it possible to monitor Twitter traffic to detect trends in nonmedical use of prescription drugs?

What did the researchers do?

Between June and November 2015, Kalyanam and her colleagues used Twitter’s Application Programming Interface stream to collect 11 million English language tweets that contained keywords denoting prescription analgesic opioids. They focused on Percocet®, Oxycontin®, and OxyCodone. They used a machine learning algorithm to cluster the tweets by drug and topic, and then inspected the clusters and identified the overarching themes of each cluster (e.g., news articles, sale and distribution of drugs, use of the drugs). In three stages, Kalynam and her colleagues eliminated clusters of tweets that did not pertain to nonmedical use of prescription drugs (see Figure 1).1

What did they find?

The researchers were able to distinguish tweets referencing actual nonmedical drug use from tweets on other topics (e.g., sale of said substances, news articles and headlines related to these substances) (see Figure 1). Most of the clusters corresponding to trends n nonmedical use of Percocet, OxyContin, and Oxycodone contained tweets mentioning the use of drugs in combination (e.g., Percocet and Xanax, Percocet and alcohol, Oxycodone and Xanax). Some clusters contained tweets whose common elements were the use of additional controlled substances (e.g., Oxycodone and heroin, Oxycodone and ecstasy).

Why do these findings matter?

The observed clusters could be a sign of a greater trend of people misusing multiple drugs at the same time. If so, then further studies should ascertain how widespread this phenomenon is, and what actions policymakers and treatment providers should be taking in response. In terms of research methods, this study suggests that by trawling social media posts and filtering based on content, researchers can learn about subgroups of interest and detect trends in a way that is more efficient than surveys. The faster that researchers can spot these shifts and investigate them, the faster that policymakers can act in the interest of the public health.

Every study has limitations. What are the limitations in this study?

The machine learning algorithm monitored the text of tweets, not any attached pictures or weblinks. Thus, for some tweets, context or intent might have been lost. Furthermore, this study was exploratory. The themes were not confirmed or corroborated by a cohort of nonmedical prescription drug users.

Figure. Numbers of tweets referencing Percocet, OxyContin, and Oxycodone left in the data set after each round of filtering. Adapted from Kalyanam et al. (2017). Click image to enlarge.

For more information:

The National Institute on Drug Abuse (NIDA) has a webpage on the misuse of prescription drugs.

The Substance Abuse and Mental Health Services Administration (SAMHSA) has a brochure called “Talking to Your Kids About Prescription Drug Abuse: Not Worth the Risk.”

— Matthew Tom

What do you think? Please use the comment link below to provide feedback on this article.


[1] They used the machine learning algorithm and human inspection each twice more to remove tweets not relevant to nonmedical use of prescription drugs and increase the signal-to-noise ratio.

2 thoughts on “STASH, Vol. 13(11) – #NotHowThatDrugShouldBeUsed: Tweets on nonmedical use of prescription drugs

  1. Birdburrr Reply

    So I see you qoute one of my tweets as a tweet “referencing actual nonmedical drug use”
    However had you even bothered to read over my feed for that time you would see that tweet was in reference to prescribed medication being used for post surgery recovery as directed by my doctor.
    If you’re going to take my words and use them as the ideal example for your study, perhaps take the time to insure that:
    a) context is taken into account
    b) the person you are going to qoute for your American based study is actually from America…
    Seeing as you could not even got your prime example correct, this shows how sloppy the study was and how flawed the findings would be.
    But thanks for trying to paint me as some kind of addict.

  2. Division on Addiction Reply

    Thanks for your interest in The BASIS. To clarify, we did not conduct this study ourselves. The study’s authors included your tweet and others to illustrate their findings. In light of your comment, we have deleted the tweet examples from our summary. You can find more about the original study here:

Leave a Reply

Your email address will not be published. Required fields are marked *