Skip to main content
NPJ Mental Health Research logoLink to NPJ Mental Health Research
. 2024 Dec 6;3:62. doi: 10.1038/s44184-024-00107-5

Detecting and tracking depression through temporal topic modeling of tweets: insights from a 180-day study

Ranganathan Chandrasekaran 1,2,, Suhas Kotaki 1, Abhilash Hosaagrahaara Nagaraja 1
PMCID: PMC11624259  PMID: 39643656

Abstract

Depression affects over 280 million people globally, yet many cases remain undiagnosed or untreated due to stigma and lack of awareness. Social media platforms like X (formerly Twitter) offer a way to monitor and analyze depression markers. This study analyzes Twitter data 90 days before and 90 days after a self-disclosed clinical diagnosis. We gathered 246,637 tweets from 229 diagnosed users. CorEx topic modeling identified seven themes: causes, physical symptoms, mental symptoms, swear words, treatment, coping/support mechanisms, and lifestyle, and conditional logistic regression assessed the odds of these themes occurring post-diagnosis. A control group of healthy users (284,772 tweets) was used to develop and evaluate machine learning classifiers—support vector machines, naive Bayes, and logistic regression—to distinguish between depressed and non-depressed users. Logistic regression and SVM performed best. These findings show the potential of Twitter data for tracking depression and changes in symptoms, coping mechanisms, and treatment use.

Subject terms: Anxiety, Depression

Introduction

Depression as a mental illness has been a great concern worldwide, with more than 280 million individuals affected1. In the USA, nearly 21 million people suffer from depression with higher incidence among women and younger individuals2,3. Depressed individuals may experience a lack of interest in work or daily activities, sleep disorders, fatigue, inability to focus, recurrent thoughts of death, and an increased risk of suicide. Despite the availability of effective treatments, depression goes undiagnosed and untreated in several cases. Depressed individuals may not seek treatment because they may simply be unaware of the condition or get inhibited by the stigma associated with it. Untreated depression or delay in treatment is associated with poor outcomes including worsened mental health and other conditions such as illicit drug disorders, and criminal and social functioning.

Depression is diagnosed by clinicians through multiple screening tools4,5 that use self-reported questionnaires and interviews. Despite their reliability, they have been criticized for the choice of cut-offs used6,7, ambiguity in items8, limitations in applying cross-cultural settings911, and biases induced by self-reported data. In addition to the diagnostic instruments, clinicians now have access to substantial amounts of data from social media that provide valuable clues about patients’ health. A number of studies have used social media data and machine learning algorithms to detect depression based on the content and language used1218, emotions expressed1921, and pictures posted22,23.

Self-disclosure, defined as “the act of revealing personal information to others”24 (p. 2), involves sharing updates, thoughts, experiences, and feelings25. For those with mental health issues like depression or anxiety, it serves as a coping mechanism and enhances well-being. Despite risks such as stigmatization and social isolation26,27, self-disclosure offers therapeutic benefits, including social support and connectedness28. Both verbal and written self-disclosures have therapeutic benefits. Writing about emotions helps create coherent narratives, enhances self-reflection, and improves mental health29.

The advent of the internet and the proliferation of social media platforms have opened up new possibilities for rapid, self-disclosure of personal information to a fairly large set of people over the digital networks14,30. Self-disclosure in social media platforms can take multiple forms including posts revealing personal information, status updates, revealing personal preferences or opinions, narratives of experiences, or displays of pictures and videos. Studies have documented that individuals disclose information about their mental illnesses in their posts on social media networks such as Facebook31,32, X (formerly known as Twitter)3335, and Instagram23,36. Such self-disclosures on social media provide individuals with a safe space for expressing themselves, while also providing a sense of community, and offering opportunities for coping and empowerment37.

Several studies have examined the self-disclosure of mental illnesses on social media to better understand the extent and nature of information being shared and discussed. These studies have examined the broader themes of discourse, language used in the narrative, timing of disclosures, patterns in the words used, etc. using qualitative content analysis33,34,3841. Collectively, these studies provide evidence of the distinct nature of writing and the language used in social media posts by depressed individuals. Another group of studies has employed advanced machine learning and natural language processing techniques to assess disclosures on social media to detect or predict the risk of depression or other mental illnesses. The focus of these studies has been to unobtrusively observe the user-generated content on social media to assess the onset and nature of mental illness, and build classifiers to distinguish between mentally ill users and healthy ones14,18,20,4247. In addition to social media posts, journal entries have also been used to identify thematic markers of mental health disclosures48. Collectively, these studies show that the textual content of the discourse in social media, and personal demographics such as age and gender can facilitate automated detection and classification of individuals with mental illness such as depression. Recent studies have also highlighted the use of social media data to estimate population mental health49. Our analysis of the current literature reveals some critical gaps. There is only limited examination of the use of social media data to understand how mental illness progresses over time50. The nature of the narrative of depressed users could change over time51, and we don’t have much knowledge about the changes that occur in the discourse of depressed users. Specifically, we do not know if the clinical diagnosis of depression and its self-disclosure over social media results in any significant changes in the nature of discourse of the depressed individuals. This study seeks to address these gaps.

This study proposes a novel, temporal analysis approach that involves assessing social media data to detect changes in the content of tweets before and after a depression. We combine text mining techniques with machine learning classifiers to detect and distinguish depressed users, and examine how depression markers change prior to and after clinical diagnosis of depression. Our approach and key contributions can be summarized as follows.

  1. Using Twitter data of depressed patients who self-disclose their clinical diagnosis, we propose a novel approach involving temporal analysis of tweets to identify and track changes in depression markers ninety days before and ninety days after disclosure of diagnosis. The temporal assessment addresses a critical gap in current literature and responds to research calls that have been made in this regard38,50,52,53.

  2. We use CoreX topic modeling to derive a rich set of features that distinguishes depressed users from healthy users. This allows us to identify thematic markers of tweets whose changes precipitate diagnosis, as well as changes that ensue clinical diagnosis of depression. We calculate the odds of an individual tweeting about a particular depression thematic marker (e.g., physical symptoms) over time. Our study provides insights into changes seen in depressed users’ tweets before and after diagnosis.

  3. We perform a comparative evaluation of multiple machine learning classifiers to determine an optimal classifier to detect depressed patients from their tweets.

Methods

Data collection and user selection

Our overall research methodology is shown in Fig. 1. We searched for English-language tweets from Twitter via its public streaming application programming interface, using a set of keywords indicative of self-reported diagnoses of depression. For inclusion, the tweets had to satisfy three criteria. (i) contain keywords and phrases indicating depression (eg. ‘depress’, ‘depression’, ‘major depression’, and its variants), (ii) mention diagnosis (eg. ‘diagnose’, ’assessed’ and variants), and (iii) timestamp indicating the actual date of diagnosis (e.g., today, yesterday, two days ago, etc.). We further checked the tweets to ensure that they contained one of the personal pronouns: I, my, or me, so that the tweets were about themselves. We searched all the tweets that were made in 2019–2020, and filtered 258 users that met our criteria. We further scrutinized the tweets manually and removed duplicates of others’ posts, and those that seemed to be not about self (e.g., “my husband got diagnosed for depression today”).

Fig. 1. Overview of research methods.

Fig. 1

Research process illustrating data collection, preprocessing, and analysis using text mining and machine learning classifiers.

For each user, based on the diagnosis date, we extracted and examined all the tweets made by each user in the ninety days preceding and succeeding the diagnosis date. Our choice of 180 days surrounding the disclosure date is guided by and consistent with other studies that have examined longitudinal data from social media5456. We, therefore, eliminated users who did not have adequate tweets in the ninety days prior to and after their diagnosis. We removed retweets and retained only the original ones. We obtained the age and gender information of users by searching the tweets made by a user to see mention of age or gender-related information. We removed those users where age and gender could not be determined. Our final dataset contained 229 self-disclosed, clinically diagnosed depressed users who made 246,637 tweets in the 180 days surrounding the diagnosis date. Of the total tweets, 125159 (50.75%) were made prior to clinical diagnosis, and 121,478 (49.25%) were made in the post-diagnosis period. Each day in our examination period saw about 1370 tweets made by depressed users. Table 1 presents the demographics of users in our dataset and Table 2 shows a sample of self-disclosure tweets.

Table 1.

Demographics of users in the dataset

n % Number of tweets prior to depression diagnosis Number of tweets after depression diagnosis
Age
 ≥18 38 16.59 16,070 20,271
 19–29 126 55.02 69,520 66,717
 30–39 27 11.79 19,943 15,782
 ≥40 38 16.59 19,626 18,708
Gender
 Male 118 51.53 63,570 56,531
 Female 111 48.47 61,589 64,947
Total 229 100 125,159 121,478

Table 2.

Illustrative tweets disclosing depression diagnosis

I went to the therapist today. I’ve been diagnosed with depression and was prescribed some antidepressants hopefully I’ll feel human again and not as hollow and unfeeling as before.
I finally saw a psychiatrist today and was clinically diagnosed with anxiety, depression, and PTSD. Here’s to hoping meds help me finally get on track!!
I was officially diagnosed with severe depression today.
I was diagnosed with severe depression and anxiety today. I start therapy In a week and I’m just proud I can finally start working through trauma and healing.
Today I got officially diagnosed (finally) with depression anxiety and obsessive-compulsive tendencies. I will start therapy in 2 weeks and see if I can finally improve my life.
So I was diagnosed with depression/anxiety today. Kind of figured that would happen at least now I can get it under control.
Today I was diagnosed with depression, anxiety w/panic disorder.

Parallely, we constructed a control group dataset that will allow statistical comparisons between users who self-disclosed their depression and those who did not. For each depressed user, we randomly identified a matched control user, matched by age and gender, and collected tweets made by them in the 180-day period surrounding the disclosure date of the depressed user. Additionally, we ensured choosing a non-depressed matched pair user by checking they did not have any mention of depression-related terms in their tweets. In this way, we compiled the timeline of tweets for a matched control group of users. This resulted in 284,772 tweets made by control group users, averaging 1026 tweets each day.

Analytical techniques

We were primarily interested in two types of comparisons. First, to compare social media disclosures by depressed users before and after clinical diagnosis. Second, to examine differences in markers between depressed and non-depressed (control group) users.

To perform the temporal analysis of social disclosures prior to and after the clinical diagnosis of depression, we employed a machine learning technique for text mining known as topic modeling to identify hidden topics in Twitter posts. Topic modeling is a useful approach to identifying broader themes in textual data that are not captured by simpler text analysis at the level of words, tokens, and sentences. Topic modeling has been widely used to assess social media data in mental health contexts57,58, and topic modeling on notes from electronic health records have been found to be effective in predicting depression59,60.

There are several popular topic modeling approaches, including the latent Dirichlet allocation (LDA) algorithm61, that utilize probabilistic generative models that speculate the mechanisms for how documents are generated in order to infer latent topics. A relatively new approach, correlation explanation (CorEx) does not assume any underlying domain knowledge and finds coherent, meaningful, hidden topics from the text62. CorEx has been increasingly used in several health-related studies to assess social media data6366.

Before performing topic modeling, we cleaned and preprocessed the tweets in two steps. All the words in the tweets were transformed into lowercase, and @mentions, special characters, emojis, and URLs were removed. We also removed stopwords. We then performed lemmatization, a procedure in NLP to identify the root form of inflected words in the English language. spaCy, a NLP library in Python was used for preprocessing and lemmatization.

We implemented the CorEx on our dataset with a different number of topics (n = 10, 20, 30, 40, and 50). The specification of the number of topics is important to identify the appropriate latent topics underlying the tweets. Specifying a larger number might produce redundant, irrelevant, or unclear topics. To figure out the optimal number of topics, we computed the distribution of total correlations for each topic to see how much correlation each additional topic contained. This was iteratively done to find the optimal number of topics that could be grouped by the authors into higher-level themes that were meaningful and consistent with our research goals pertaining to depression detection. The correctness of the categorization of topics into themes and keywords was assessed through review by two clinicians who are experts in mental health.

Our next step was to assess the extent to which each tweet was associated with the themes that were discovered from topic modeling. This was done by examining point-wise total correlation (TC) scores provided by CorEx for each of the tweets. CorEx provides a vector of TC values (log_z) that indicates the strength of the association of a given tweet with each of the topics. The vector of TC scores indicates the strength of the association of a given tweet with each of the topics extracted. TC scores for each theme were then averaged for each day for all users and corresponding z-scores were computed, covering the pre-disclosure and post-disclosure periods. This helped us observe theme-specific changes and variations longitudinally in the periods preceding and succeeding the depression diagnosis.

We used conditional logistic regression to compute the odds of a user tweeting about a specific theme (e.g. mental symptoms) in the post-diagnosis, as compared to the pre-diagnosis period. For instance, what are the odds of an individual user who has disclosed the clinical diagnosis of depression on Twitter to tweet about the causes of depression post-diagnosis, as compared to pre-diagnosis? Analyses were done using the “clogit” command in STATA software.

Finally, to assess differences between depressed and control group users, we built binary classifiers using the TC scores for themes extracted from the previous step as principal features, along with demographic variables age and gender. We implemented three classification algorithms: logistic regression (LR), support vector machines (SVM), and Naïve Bayes (NB) classifiers via ScikitLearn. These techniques have been commonly used in studies using social media for mental health67. We used a ten-fold cross-validation wherein the dataset was randomly divided into ten subsets with the same sample size. The performance of classification models was assessed using five metrics: accuracy, precision (number of true positives over the sum of the number of true positives and false positives), recall (number of true positives over the sum of the number of true positives and false negatives), F1 measure (tradeoff between precision and recall, captured by their harmonic mean) and recipient operating classification (ROC) curves.

Results

Themes from topic modeling

The results from the CorEx topic modeling highlighting the broader themes along with the most contributing keywords are presented in Table 3. The seven themes revolve around the characteristics of depression and are prevalent in both periods before and after the diagnosis disclosure. However, we observe distinct shifts and patterns in the occurrences of these themes in the tweets before and after the diagnosis disclosure. Figure 2 shows the theme-specific variations in z-scores across the entire time period of examination.

Table 3.

Themes and keywords from topic modeling

Themes Top contributing keywords
Causes Attack, death, war, suffering, abuse, rape, trauma, accident, assault, harassment, torture, and divorce.
Physical symptoms Sleep, headache, vomiting, nightmare, pain, migraine, aches, insomnia, vision, and appetite.
Mental symptoms Cry, sad, panic, stress, upset, anger, worry, mood, suicide, guilt, anxiety, empty, lonely, panic, insecurity, suicide, frustration, disgust, and depression.
Swear words and cursing Sshit, fuck, bitch, ass, damn, suck, trash, bullshit, asshole, crap, bastard, whore, and goddamn.
Treatment Doctor, therapy, therapist, hospital, treatment, antidepressant, drug, meds, psychiatrist, psychologist, Zoloft, Prozac, and pill.
Coping and support mechanisms Exercise, gym, motivate, heal, diet, recovery, hobby, yoga, hope, fitness, run, and support.
Lifestyle Video, art, music, book, cat, dog, play, event, party, reading, pet, writing, vacation, and gaming.

Fig. 2. Temporal variations in theme z-scores across the pre- and post-diagnosis periods.

Fig. 2

Each panel depicts the variations in the themes extracted topic modeling of Twitter posts in the 90-day pre-diagnosis period, and 90 days post-diagnosis. Each panel pertains to one of the themes (a) causes, b physical symptoms, c mental symptoms, d swear words, e treatment, f coping and support mechanisms, and g lifestyle.

For the theme pertaining to causes of depression, we find keywords such as attack, accident, trauma, divorce, death, threat, and harassment to characterize this theme. These words capture some of the major causes of depression as expressed by the patients in their tweets. Though the exact causes of depression might differ, past research has documented marital dissolution68,69, trauma70, intimate partner violence71, and bereavement72 as some of the common causes of depression. Usage of the keywords in tweets such as, “I have been traumatized by my brother raping me”, and “This whole situation is really making me think of my assault and it is so sad. My assaulter left me in my vomit” reveal that users in our dataset were engaging in discussing their personal experiences and causes for depression. Figure 2a gives insights into the trends pertaining to this theme in the period prior to and after the depression diagnosis. Depressed users engaged in discourses about causes much more in the post-diagnosis period as compared to the pre-diagnosis phase. Once clinically diagnosed, users seem to reflect on the causes of depression and share this information on social media.

The second theme pertained to physical symptoms experienced by depressed users. Keywords such as headache, vomit, nightmare, sleep, and pain characterize this theme. These keywords pertaining to physical symptoms seem to point out comorbidity of depression with other disorders such as insomnia73, migraine74, and chronic pain75, validating prior studies. Tweets such as “ I have to get up in 6h and it takes me 2h to even fall asleep” and “Laugh all u want but behold some of the reasons for me to continue living despite being in pain & battling insomnia” provide pointers to potential comorbid conditions in the depressed users. From Fig. 2b, we note that users reveal physical conditions well before the formal diagnosis of depression. The discussion about physical symptoms decreases after the diagnosis and disclosure.

The third theme relates to the mental conditions of depressed patients. We found several keywords that characterize this theme viz. cry, sad, panic, stress, worry, mood, suicide, guilt, anxious, empty, lonely, etc. Many of these keywords resonate closely with indicators that have long been identified with depression and have been regularly used in depression screening scales like the Patient Health Questionnaire76. Our results are consistent with other studies that have identified similar keywords associated with depression48,58. Our findings indicate that Twitter posts of depressed users often contained explicit references to their mental conditions that are relevant to the disorder. When we examined the trends of mental conditions over time, we found the z-scores associated with the expression of mental symptoms to be relatively more in the pre-diagnosis phase as compared to the post-diagnosis period. Our findings suggest that social media data shows mental symptom markers much before depression is clinically diagnosed, however, the mental symptoms, as expressed in social media, seem to decline in the post-diagnosis period.

Fourth, we detected swearing to be a key theme in the discourse associated with depression. In broader terms, swearing refers to the activity of using taboo words to convey strong emotions77. Swearing has been seen as an approach to reduce pain or tension release in individuals.78. Depressed users tend to swear in the presence of others79 and prior studies have found swearing to be a distinctive marker of language used by depressed users57,80. Our topic modeling results showed depressed users commonly use swear words in their Twitter posts. This was prevalent in both time periods preceding and succeeding the clinical diagnosis.

The fifth theme concerns depression treatments. We found disclosing users to share content about their anti-depression medications, side effects, clinic visits, counseling, therapy sessions, and treatment plans. Twitter uses in our dataset shared tweets such as “I started taking zoloft today”, “I got myself a doctors appointment I was diagnosed with severe depression and panic disorder/anxiety and have been put on sertraline (Zoloft) antidepressant”, “I’m still depressed and now on Seroquel. And my mouth may permanently taste terrible.” We also found users to share their experiences with drugs and treatment plans. When we examined the temporal trends about treatments, we found z-scores to be higher in the post-diagnosis and disclosure phase as compared to the earlier period.

We labeled the sixth theme as ‘coping and support mechanisms’ based on the associated keywords which included exercise, workout, diet, yoga, gym, heal, hope, support, etc. This theme broadly relates to physical, behavioral, and emotional efforts to deal with stressful events that can eventually lead to or increase depression disorder. We found Twitter users in our dataset to share information about their exercise routines and intentions. For instance, tweets such as “Started back exercising as part of my mental health recovery”, and “Currently trying to gain the courage to go to the gym later today. I’m so sick of the way I look” indicate the use of exercise as a part of the coping process of some of the depressed users. We found depressed users in our dataset to disclose changes to their diet and food behavior “I’m going vegan”, I’m trying to avoid fried foods and eat /healthy/”, “I started doing the keto diet around March 10th and I weighed 165 lbs I now weigh 146lbs. I’m really proud.” We also found mentions of yoga by depressed users in many tweets: “It’s gonna be lots of fun since I’m doing a yoga retreat”, “We just did power yoga and that shit was hella intense”, “Workout done now time to get ready for yoga”. Trends from Fig. 1f indicate some noticeable changes in the use of coping and support mechanisms after clinical diagnosis, though some of these mechanisms were mentioned in the pre-diagnosis period as well.

The seventh theme was labeled as lifestyle. This theme was characterized by keywords such as pets, dog, cat, video, music, vacation, art, game, event, etc. This theme consisted of tweets that were suggestive of general lifestyle and activities that were pursued by the users such as video gaming, travel, use of pets, etc. Depressed users had tweeted about the helpfulness of pets (e.g., “Life is hard I just wanna be in bed with my cat”) and video games (e.g., “gaming makes me the happiest but it gets lonely”). We found z-scores of the lifestyle theme to be almost similar in both pre- and post-diagnosis periods.

In Table 4, we present the results of the conditional logistic regression and resultant odds ratios pertaining to a user tweeting about a particular depression theme in the post-diagnosis period compared to tweeting about the same theme in the pre-diagnosis period. The odds ratios help us assess the likelihood of the depression theme occurring in the tweets in the post-diagnosis period as compared to the pre-diagnosis period. Our results indicate that depressed users are likely to tweet more about causes, treatment, and coping and support mechanisms in the post-diagnosis period as compared to the pre-diagnosis period. Further, we also find that depressed users are less likely to tweet about physical symptoms, mental symptoms, and the use of swear words in the period following a depression diagnosis. The odds ratio pertaining to lifestyle-related tweets was found to be insignificant.

Table 4.

Likelihood of tweeting about depression themes pre- and post-diagnosis: conditional logistic regression results

Theme Odds ratio 95% CI p
Causes 2.22 1.29–3.82 p < 0.001
Physical symptoms 0.32 0.14–0.71 p < 0.001
Mental symptoms 0.74 0.62–0.89 p < 0.001
Swear words 0.73 0.53–1.01 p < 0.05
Treatment 3.1 1.71–5.61 p < 0.001
Coping and support mechanisms 1.86 1.24–2.81 p < 0.001
Lifestyle 1.24 0.85–1.82 Not sig.

Machine learning classifiers to distinguish depressed users from the control group

In order to validate and establish associations surrounding the themes extracted from the discourse of depressed users, we built three different binary classifiers (SVM, LR, and NB) to compare with our matched control group. We implemented a ten-fold cross-validation routine for the classification task where the entire dataset was divided into ten equally sized subsets, and the classification was performed ten times, each time with a different subset as test data, and all other subsets included as training data. The classification performance metrics for each of the iterations were then averaged. Performance metrics of the binary classifiers are shown in Table 5.

Table 5.

Performance metrics for classifier algorithms (depressed users vs control group)

Metric SVM LR NB
Accuracy 90.93 90.58 79.71
Recall 92.61 90.61 79.8
Precision 90.2 90.63 80.1
AUC ROC 0.91 0.91 0.8
F1-score 91.21 90.58 79.67

The results show that both LR and SVM yielded the best performance with an average accuracy, precision, recall, and F-1 score exceeding 90. The good performance of LR (AUC = 0.91) and SVM (AUC = 0.91) is also evident from Table 5. We found that the inclusion of themes from CorEx topic modeling, controlling for age and gender yields better performance as compared to the model that included themes only. Our classifier is able to better detect and distinguish depressed users from their Twitter posts. We also built additional classifiers based on pre-diagnosis tweets of depressed users, and post-diagnosis of depressed users and assessed if they distinguished from the control group, and found acceptable performance of classifiers. However, the performance metrics of classifiers using combined tweets were relatively higher than those that use a subset of pre-diagnosis tweets or post-diagnosis ones.

Discussion

Analysis of self-disclosures about depression in social media can provide rich insights into the onset and progression of the disease in individuals. By analyzing the content shared around depression on Twitter, this study demonstrates that a more comprehensive view of depression including its causes, potential comorbidities, mental symptoms, experience with treatments, and coping mechanisms can be obtained by mining social media data. By examining a corpus of tweets from 229 depressed users over 180 days using text mining and machine learning techniques, we have noted changes to the social media content posted by depressed users over time. We identified seven themes that serve as markers of depression in the Twitter discourse of depressed users and found distinct differences in these markers in periods preceding and succeeding the date of clinical diagnosis. We found depressed users to likely disclose potential causes of their condition after the clinical diagnosis, whereas the physical and mental symptoms, including comorbidities, start manifesting much before the actual diagnosis. However, in the post-diagnosis period, there are trends from tweets that are indicative of a decrease in negative conditions such as physical and mental symptoms. We found depressed users in our dataset to indicate embracing different coping strategies and support mechanisms, in addition to discussing the efficacies of the clinical treatments.

The themes identified offer interesting insights into how individuals discuss their mental health, particularly in the context of depression on social media. For example, the themes related to causes of depression often included trauma, divorce, and loss, with increased discourse on these topics in the post-diagnosis period. This suggests that after receiving a diagnosis and disclosing it on social media, individuals are more likely to reflect on and share the triggers or root causes of their mental health struggles. For instance, one of the users had tweeted “My parents were getting divorced”, citing divorce and separation of parents as the reason behind his depression. Another user has indicated the abusive marriage as the main cause of her depression as seen in the tweet “I got into a marriage that was abusive”.

The presence of physical symptoms, such as headaches, sleep disturbances, and pain, often appeared in tweets well before the diagnosis, reflecting common comorbidities that have been observed in depression research. Symptoms such as sleeplessness and headaches were mentioned by multiple users as evidenced in the illustrative post: “I don’t sleep.. I get headaches and severe nightmares”. Post-diagnosis, the prevalence of such symptoms tended to decrease. This reduction could be due to clinical interventions following the diagnosis. Text mining of users’ social media posts can provide significant insights into the presence of comorbid conditions in depressed users. Identifying such comorbidities could greatly enhance the treatments and clinical interventions provided to depressed patients.

Mental symptoms, including sadness, anxiety, and feelings of emptiness, were also expressed predominantly in the pre-diagnosis phase, indicating that users often experienced significant psychological distress before seeking a formal diagnosis. Tweets such as “I’m tired of being lonely,” “Feeling anxious all the time,” and “It’s lonely out here… and I don’t get out much” offer cues about the emotional and psychological distress. These illustrative posts reflect key mental symptoms commonly associated with depression, including persistent feelings of loneliness, isolation, and anxiety. The repetitive nature of these sentiments underscores the depth of their distress, as individuals use social media to articulate their emotional pain and the ongoing challenges in their daily lives. Post-diagnosis, discussions of these symptoms on social media appear to have decreased, perhaps due to therapy or medication.

Interestingly, the use of swear words remained fairly constant before and after diagnosis, which may highlight their use as emotional outlets throughout the depression experience. The themes around treatment and coping mechanisms reflect individuals’ engagement with healthcare services and self-care practices. Post-diagnosis tweets often included references to antidepressants (e.g., Zoloft, Prozac, Dopemin, etc.), therapy, and side effects of medications, emphasizing the role of social media in allowing users to share their treatment experiences. Sharing treatment information via social media may provide depressed users with a sense of shared identity and support81. Meanwhile, tweets about coping mechanisms such as exercise, diet, and yoga suggest that users actively seek and implement specific strategies to manage their depression. Engagement in physical activities such as exercise has been documented as an effective mechanism for coping with depression82,83. Past research has indicated Yoga84 and diet changes85 as useful mechanisms to deal with depression. These behaviors, which were mentioned both before and after diagnosis, highlight the importance of self-care in the mental health journey.

The lifestyle theme, which includes discussions about pets, music, and video games, remained consistent throughout, suggesting that these elements of everyday life continue to play a role in managing depression, irrespective of the formal diagnosis. Our findings are consistent with prior research where pet ownership86 and playing casual video games have been found to exhibit a positive impact on depressed individuals87,88.

Some of the major challenges in treating depression relate to non-detection or delayed detection of the disorder, and the lengthy delays between symptom onset and receiving appropriate treatment. We show that mining the social media data can not only provide clues about depression symptoms much before it is formally diagnosed, but also provide a more comprehensive view of the progression of the disease and adjustments being made by depressed patients. We contribute to the extant research by providing a temporal assessment of depression markers over time, specifically by documenting changes in the content of social media posts before and after diagnosis. We provide insights into changes in coping strategies, lifestyle adjustments and treatments that depressed users go through in the time periods prior to and after the clinical diagnosis. Our approach to using themes as primary features to classify depressed users from others yielded performance metrics that are quite comparable and even better than some of the prior studies14.

From a methodological perspective, we have combined text mining, machine learning, and statistical modeling to derive rich insights into discourse regarding depression on social media. Our work demonstrates the use of social media data to gain deeper knowledge on multiple themes pertaining to depression and the changes in discourse patterns over time. Additionally, our approach provides a potentially effective way to study depression, offering insights that could be applicable in both clinical practice and community support settings. By identifying changes in depression-related discourse, this method can help mental health professionals and community organizations monitor mental health trends and provide timely interventions, offering an unobtrusive means of supporting individuals dealing with depression.

For health professionals, these findings underscore the importance of monitoring social media for early signs of depression. The temporal changes in themes can provide valuable insights into a patient’s mental state and the effectiveness of treatments. For instance, a decrease in tweets about physical symptoms post-diagnosis may indicate successful management of comorbid conditions, while an increase in discussions about treatment could reflect ongoing engagement with healthcare services. By incorporating social media analysis into clinical practice, health professionals can obtain real-time data to tailor interventions more effectively and support patients throughout their treatment journey. However, it is crucial to ensure that ethical guidelines, including patient consent, privacy protection, and responsible use of personal data, are strictly followed to safeguard individuals’ rights.

Caregivers and family members can also benefit from understanding the online behavior of individuals with depression. Awareness of the themes and their progression can help caregivers provide timely support and intervention. For example, an increase in tweets about coping mechanisms and support networks post-diagnosis suggests a critical period where individuals are actively seeking and benefiting from social support. Encouraging positive interactions and engagement during this time can significantly enhance the well-being of the individual.

On a broader scale, public health initiatives can leverage these insights to design more effective mental health campaigns. The ability to detect and monitor depression through social media offers a scalable and unobtrusive method to reach a larger population. Public health organizations can use this data to identify trends, allocate resources more efficiently, and create targeted interventions that address the specific needs of different demographic groups. Additionally, understanding the stigmatization associated with self-disclosure of mental health issues on social media can inform strategies to reduce stigma and encourage more open conversations about mental health.

This study has several limitations that should be acknowledged. Our analysis relies exclusively on users’ self-disclosures of their mental health conditions on Twitter, which may not be fully representative, as many individuals may choose not to disclose such information or provide only limited details. Moreover, the Twitter user base may not reflect the broader population of individuals with depression, limiting the generalizability of our findings. Additionally, users’ tweet frequency could vary significantly over a period of time, especially, between the pre- and post-diagnosis periods, which may affect the results.

While we documented changes in tweet content before and after diagnosis, we did not assess whether these changes indicated an improvement or worsening of the users’ mental health. Nor did we analyze the quantity, frequency, or specific timing of tweets. Future research could explore whether these factors, along with users’ social networks and tweeting behavior, can provide deeper insights into their mental health trajectories. Further research is needed to assess if the quality of social media posts and posting behavior can be indicative of improvement or worsening of the mental health of depressed users. We also did not consider the user’s social network (e.g., number of followers) and tweeting behavior which could be additional indicators associated with their mental health.

Further, we did not distinguish between different kinds of depression disorders such as bipolar disorder, PTSD, etc. and it is possible that the depression markers vary between them. Although a number of studies have used linguistic variables using tools such as LIWC to detect depression in social media posts with mixed results, we chose to focus on thematic markers. Future studies could also incorporate linguistic, as well as thematic markers, and use Generative AI tools such as GPTs to assess patient-authored social media posts to detect depression from social media posts.

This study demonstrated the effectiveness of text mining and machine learning techniques in detecting and analyzing differences in social media content before and after a depression diagnosis. In addition to detecting potential symptoms, social media data gave more comprehensive information about how depressed users adapt and adjust their behaviors over a period of time. Our findings highlight the potential of using social media data to detect shifts in tweet content, offering valuable clues for real-time identification and monitoring of mental health issues. These insights provide a foundation for providing targeted clinical interventions and tailored support to individuals suffering from depression.

Acknowledgements

This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.

Author contributions

Data gathering, data preparation, and data analysis: S.K. Data gathering, data preparation, and data analysis: A.H.N. Study design, conceptualization, data analysis, interpretation, and writing: R.C. All authors reviewed the manuscript.

Data availability

The dataset, containing the tweet-ids of posts by depressed users, used for this study can be obtained from the corresponding author on request.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Depressive disorder (depression). https://www.who.int/news-room/fact-sheets/detail/depression.
  • 2.Brody, D. J., Pratt, L. A. & Hughes, J. P. Prevalence of depression among adults aged 20 and over: United States, 2013–2016. NCHS Data Brief303, 1–8 (2018). https://www.cdc.gov/nchs/products/databriefs/db303.htm. [PubMed]
  • 3.Major depression. National Institute of Mental Health (NIMH)https://www.nimh.nih.gov/health/statistics/major-depression.
  • 4.El-Den, S., Chen, T. F., Gan, Y.-L., Wong, E. & O’Reilly, C. L. The psychometric properties of depression screening tools in primary healthcare settings: a systematic review. J. Affect. Disord.225, 503–522 (2018). [DOI] [PubMed] [Google Scholar]
  • 5.Handbook of Clinical Rating Scales and Assessment in Psychiatry and Mental Health (Humana Press, Totowa, 2010). 10.1007/978-1-59745-387-5.
  • 6.Stockings, E. et al. Symptom screening scales for detecting major depressive disorder in children and adolescents: a systematic review and meta-analysis of reliability, validity and diagnostic utility. J. Affect. Disord. 174, 447–463. 10.1016/j.jad.2014.11.061 (2015). [DOI] [PubMed]
  • 7.Kokoszka, A., Cichoń, E., Obrębski, M., Kiejna, A. & Rajba, B. Cut-off points for Polish-language versions of depression screening tools among patients with Type 2 diabetes. Prim. Care Diabetes.10.1016/j.pcd.2020.05.015 (2020). [DOI] [PubMed]
  • 8.Coyne, J. C. & van Sonderen, E. No further research needed: abandoning the hospital and anxiety depression scale (HADS). J. Psychosom. Res.72, 173–174 (2012). [DOI] [PubMed] [Google Scholar]
  • 9.Maters, G. A., Sanderman, R., Kim, A. Y. & Coyne, J. C. Problems in cross-cultural use of the hospital anxiety and depression scale: ‘no butterflies in the desert’. PLoS One8, e70975 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Zubaran, C., Schumacher, M., Roxo, M. R. & Foresti, K. Screening tools for postpartum depression: validity and cultural dimensions. Afr. J. Psychiatry. 10.4314/ajpsy.v13i5.63101 (2011). [DOI] [PubMed]
  • 11.Nuevo, R. et al. Cross-cultural equivalence of the Beck depression inventory: a five-country analysis from the ODIN study. J. Affect. Disord.114, 156–162 (2009). [DOI] [PubMed] [Google Scholar]
  • 12.Li, G., Li, B., Huang, L. & Hou, S. Automatic construction of a depression-domain lexicon based on microblogs: text mining study. JMIR Med. Inf.8, e17650 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Orabi, A. H., Buddhitha, P., Orabi, M. H. & Inkpen, D. Deep learning for depression detection of Twitter users. In Proc. Fifth Workshop on Computational Linguistics and Clinical Psychology: From Keyboard to Clinic 88–97 (ACL Anthology, 2018).
  • 14.Guntuku, S. C., Yaden, D. B., Kern, M. L., Ungar, L. H. & Eichstaedt, J. C. Detecting depression and mental illness on social media: an integrative review. Curr. Opin. Behav. Sci.18, 43–49 (2017). [Google Scholar]
  • 15.Burdisso, S. G., Errecalde, M. & Montes-y-Gómez, M. A text classification framework for simple and effective early depression detection over social media streams. Expert Syst. Appl.133, 182–197 (2019). [Google Scholar]
  • 16.Reece, A. G. et al. Forecasting the onset and course of mental illness with Twitter data. Sci. Rep.7, 13006 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.McClellan, C., Ali, M. M., Mutter, R., Kroutil, L. & Landwehr, J. Using social media to monitor mental health discussions—evidence from Twitter. J. Am. Med. Inform. Assoc.24, 496–502 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Coppersmith, G., Leary, R., Crutchley, P. & Fine, A. Natural language processing of social media as screening for suicide risk. Biomed. Inform. Insights10, 1178222618792860 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Larsen, M. E. et al. We feel: mapping emotion on Twitter. IEEE J. Biomed. Health Inf.19, 1246–1252 (2015). [DOI] [PubMed] [Google Scholar]
  • 20.Chen, X., Sykora, M. D., Jackson, T. W. & Elayan, S. What about mood swings: identifying depression on Twitter with temporal measures of emotions. In: Companion Proceedings of the Web Conference 2018 1653–1660 (International World Wide Web Conferences Steering Committee, Republic and Canton of Geneva, CHE, 2018). 10.1145/3184558.3191624.
  • 21.Hasan, M., Rundensteiner, E. & Agu, E. Automatic emotion detection in text streams by analyzing Twitter data. Int. J. Data Sci. Anal.7, 35–51 (2019). [Google Scholar]
  • 22.Reece, A. G. & Danforth, C. M. Instagram photos reveal predictive markers of depression. EPJ Data Sci.6, 15 (2017). [Google Scholar]
  • 23.Andalibi, N., Ozturk, P. & Forte, A. Depression-related Imagery on Instagram. In Proc. 18th ACM Conference Companion on Computer Supported Cooperative Work & Social Computing 231–234 (Association for Computing Machinery, New York, 2015). 10.1145/2685553.2699014.
  • 24.Jourard, S. M. Self-disclosure: an experimental analysis of the transparent self (Wiley Interscience, New York, 1971).
  • 25.Cozby, P. C. Self-disclosure: a literature review. Psychol. Bull.79, 73–91 (1973). [DOI] [PubMed] [Google Scholar]
  • 26.Brohan, E. et al. Systematic review of beliefs, behaviours and influencing factors associated with disclosure of a mental health problem in the workplace. BMC Psychiatry12, 11 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Vogel, D. L. & Wester, S. R. To seek help or not to seek help: the risks of self-disclosure. J. Couns. Psychol.50, 351–361 (2003). [Google Scholar]
  • 28.Barglow, P. Self-disclosure in psychotherapy. Am. J. Psychother.59, 83–99 (2005). [DOI] [PubMed] [Google Scholar]
  • 29.Pennebaker, J. W. & Seagal, J. D. Forming a story: the health benefits of narrative. J. Clin. Psychol.55, 1243–1254 (1999). [DOI] [PubMed] [Google Scholar]
  • 30.Edo-Osagie, O., De La Iglesia, B., Lake, I. & Edeghere, O. A scoping review of the use of Twitter for public health research. Comput. Biol. Med.122, 103770 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Ophir, Y., Asterhan, C. S. C. & Schwarz, B. B. Unfolding the notes from the walls: adolescents’ depression manifestations on Facebook. Comput. Hum. Behav.72, 96–107 (2017). [Google Scholar]
  • 32.Seabrook, E. M., Kern, M. L., Fulcher, B. D. & Rickard, N. S. Predicting depression from language-based emotion dynamics: longitudinal analysis of facebook and twitter status updates. J. Med. Internet Res.20, e168 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Lachmar, E. M., Wittenborn, A. K., Bogen, K. W. & McCauley, H. L. # MyDepressionLooksLike: examining public discourse about depression on twitter. JMIR Ment. Health4, e43 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Hswen, Y., Naslund, J. A., Brownstein, J. S. & Hawkins, J. B. Online communication about depression and anxiety among twitter users with schizophrenia: preliminary findings to inform a digital phenotype using social media. Psychiatr. Q.89, 569–580 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Mowery, D. et al. Understanding depressive symptoms and psychosocial stressors on Twitter: a corpus-based study. J. Med. Internet Res.19, e48 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Ricard, B. J., Marsch, L. A., Crosier, B. & Hassanpour, S. Exploring the utility of community-generated social media content for detecting depression: an analytical study on Instagram. J. Med. Internet Res.20, e11817 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Berry, N. et al. # WhyWeTweetMH: understanding why people use Twitter to discuss mental health problems. J. Med. Internet Res.19, e107 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Cavazos-Rehg, P. A. et al. A content analysis of depression-related Tweets. Comput. Hum. Behav.54, 351–357 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.O’Dea, B., Larsen, M. E., Batterham, P. J., Calear, A. L. & Christensen, H. A linguistic analysis of suicide-related Twitter posts. Crisis. J. Crisis. Interv. Suicide Prev.38, 319–329 (2017). [DOI] [PubMed] [Google Scholar]
  • 40.Mahoney, J. et al. Feeling alone among 317 million others: disclosures of loneliness on Twitter. Comput. Hum. Behav.98, 20–30 (2019). [Google Scholar]
  • 41.Li, A., Jiao, D., Liu, X. & Zhu, T. A comparison of the psycholinguistic styles of schizophrenia-related stigma and depression-related stigma on social media: content analysis. J. Med. Internet Res.22, e16470 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.De Choudhury, M., Gamon, M., Counts, S. & Horvitz, E. Predicting depression via social media. ICWSM13, 1–10 (2013). [Google Scholar]
  • 43.Chiong, R., Budhi, G. S., Dhakal, S. & Chiong, F. A textual-based featuring approach for depression detection using machine learning classifiers and social media texts. Comput. Biol. Med.135, 104499 (2021). [DOI] [PubMed] [Google Scholar]
  • 44.Birnbaum, M. L., Ernala, S. K., Rizvi, A. F., De Choudhury, M. & Kane, J. M. A collaborative approach to identifying social media markers of schizophrenia by employing machine learning and clinical appraisals. J. Med. Internet Res.19, e289 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45.Lossio-Ventura, J. A. et al. Evaluation of clustering and topic modeling methods over health-related tweets and emails. Artif. Intell. Med.117, 102096 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Zogan, H., Razzak, I., Jameel, S. & Xu, G. Hierarchical convolutional attention network for depression detection on social media and its impact during pandemic. IEEE J. Biomed. Health Inform.10.1109/JBHI.2023.3243249 (2023). [DOI] [PubMed]
  • 47.Kelley, S. W., Mhaonaigh, C. N., Burke, L., Whelan, R. & Gillan, C. M. Machine learning of language use on Twitter reveals weak and non-specific predictions. NPJ Digit Med.5, 35 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Oduntan, A. et al. ‘I Let Depression and Anxiety Drown Me…’: identifying factors associated with resilience based on journaling using machine learning and thematic analysis. IEEE J. Biomed. Health Inform.26, 3397–3408 (2022). [DOI] [PubMed] [Google Scholar]
  • 49.Mangalik, S. et al. Robust language-based mental health assessments in time and space through social media. NPJ Digit Med.7, 109 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50.Farruque, N., Goebel, R., Sivapalan, S. & Zaïane, O. Deep temporal modelling of clinical depression through social media text. Nat. Lang. Process. J.6, 100052 (2024). [Google Scholar]
  • 51.Cai, Y., Wang, H., Ye, H., Jin, Y. & Gao, W. Depression detection on online social network with multivariate time series feature of user depressive symptoms. Expert Syst. Appl.217, 119538 (2023). [Google Scholar]
  • 52.Giuntini, F. T. et al. A review on recognizing depression in social networks: challenges and opportunities. J. Ambient Intell. Humaniz. Comput. 10.1007/s12652-020-01726-4 (2020).
  • 53.Hasib, K. M. et al. Depression detection from social networks data based on machine learning and deep learning techniques: an interrogative survey. IEEE Trans. Comput. Soc. Syst.10, 1568–1586 (2023). [Google Scholar]
  • 54.Coppersmith, G., Harman, C. & Dredze, M. Measuring post traumatic stress disorder in Twitter. In: Eighth International AAAI Conference on Weblogs and Social Media (AAAI, 2014).
  • 55.Nadeem, M. Identifying depression on Twitter. Available at 10.48550/arXiv.1607.07384 (2016).
  • 56.Leis, A., Ronzano, F., Mayer, M. A., Furlong, L. I. & Sanz, F. Detecting signs of depression in tweets in Spanish: behavioral and linguistic analysis. J. Med. Internet Res. 21, e14199. 10.2196/14199 (2019). [DOI] [PMC free article] [PubMed]
  • 57.Nguyen, T. et al. Using linguistic and topic analysis to classify sub-groups of online depression communities. Multimed. Tools Appl.76, 10653–10676 (2017). [Google Scholar]
  • 58.Gkotsis, G. et al. Characterisation of mental health conditions in social media using informed deep learning. Sci. Rep. 10.1038/srep45141 (2017). [DOI] [PMC free article] [PubMed]
  • 59.Meng, Y., Speier, W., Ong, M. & Arnold, C. W. HCET: hierarchical clinical embedding with topic modeling on electronic health records for predicting future depression. IEEE J. Biomed. Health Inf.25, 1265–1272 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Meng, Y., Speier, W., Ong, M. K. & Arnold, C. W. Bidirectional representation learning from transformers using multimodal electronic health record data to predict depression. IEEE J. Biomed. Health Inf.25, 3121–3129 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 61.Blei, D. M., Ng, A. Y. & Jordan, M. I. Latent dirichlet allocation. J. Mach. Learn. Res.3, 993–1022 (2003). [Google Scholar]
  • 62.Gallagher, R. J., Reing, K., Kale, D. & Ver Steeg, G. Anchored correlation explanation: topic modeling with minimal domain knowledge. Trans. Assoc. Comput. Linguist.5, 529–542 (2017). [Google Scholar]
  • 63.Rizvi, R. F. et al. Analyzing social media data to understand consumer information needs on dietary supplements. Stud. Health Technol. Inform.264, 323–327 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 64.Zhou, S., Zhao, Y., Bian, J., Haynos, A. F. & Zhang, R. Exploring eating disorder topics on twitter: machine learning approach. JMIR Med Inf.8, e18273 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 65.Shankar, K., Chandrasekaran, R., Jeripity Venkata, P. & Miketinas, D. Investigating the role of nutrition in enhancing immunity during the COVID-19 pandemic: twitter text-mining analysis. J. Med. Internet Res.25, e47328 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 66.Chandrasekaran, R., Konaraddi, K., Sharma, S. S. & Moustakas, E. Text-mining and video analytics of COVID-19 narratives shared by patients on YouTube. J. Med. Syst.48, 21 (2024). [DOI] [PubMed] [Google Scholar]
  • 67.Wongkoblap, A., Vadillo, M. A. & Curcin, V. Researching mental health disorders in the era of social media: systematic review. J. Med. Internet Res.19, e228 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 68.Cohen, S., Klein, D. N. & O’Leary, K. D. The role of separation/divorce in relapse into and recovery from major depression. J. Soc. Pers. Relat.24, 855–873 (2007). [Google Scholar]
  • 69.Breslau, J. et al. A multinational study of mental disorders, marriage, and divorce. Acta Psychiatr. Scand.124, 474–486 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 70.Steel, Z. et al. Association of torture and other potentially traumatic events with mental health outcomes among populations exposed to mass conflict and displacement: a systematic review and meta-analysis. JAMA302, 537–549 (2009). [DOI] [PubMed] [Google Scholar]
  • 71.Vaeth, P. A. C., Ramisetty-Mikler, S. & Caetano, R. Depression among couples in the United States in the context of intimate partner violence. J. Interpers. Violence25, 771–790 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 72.Kendler, K. S., Myers, J. & Zisook, S. Does bereavement-related major depression differ from major depression associated with other stressful life events? Am. J. Psychiatry165, 1449–1455 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 73.Staner, L. Comorbidity of insomnia and depression. Sleep. Med. Rev.14, 35–46 (2010). [DOI] [PubMed] [Google Scholar]
  • 74.Bruti, G., Magnotti, M. C. & Iannetti, G. Migraine and depression: bidirectional co-morbidities? Neurol. Sci.33, S107–S109 (2012). [DOI] [PubMed] [Google Scholar]
  • 75.Sheng, J., Liu, S., Wang, Y., Cui, R. & Zhang, X. The link between depression and chronic pain: neural mechanisms in the brain. Neural Plast.2017, 9724371 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 76.Martin, A., Rief, W., Klaiberg, A. & Braehler, E. Validity of the brief patient health questionnaire mood scale (PHQ-9) in the general population. Gen. Hosp. Psychiatry28, 71–77 (2006). [DOI] [PubMed] [Google Scholar]
  • 77.Ljung, M. Swearing: A Cross-Cultural Linguistic Study (Springer, 2010).
  • 78.Stephens, R. & Umland, C. Swearing as a response to pain—effect of daily swearing frequency. J. Pain.12, 1274–1281 (2011). [DOI] [PubMed] [Google Scholar]
  • 79.Robbins, M. L. et al. Naturalistically observed swearing, emotional support, and depressive symptoms in women coping with illness. Health Psychol.30, 789–792 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 80.Rodriguez, A. J., Holleran, S. E. & Mehl, M. R. Reading between the lines: the lay assessment of subclinical depression from written self-descriptions. J. Pers.78, 575–598 (2010). [DOI] [PubMed] [Google Scholar]
  • 81.Lu, Y., Pan, T. & Deng, S. What drives patients affected by depression to share in online depression communities? A social capital perspective. Healthcare7, 133 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 82.Wang, X. et al. Systematic review and meta-analysis of the effects of exercise on depression in adolescents. Child Adolesc. Psychiatry Ment. Health16, 16 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 83.Hu, M. X. et al. Exercise interventions for the prevention of depression: a systematic review of meta-analyses. BMC Public Health20, 1255 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 84.Wu, Y., Yan, D. & Yang, J. Effectiveness of yoga for major depressive disorder: a systematic review and meta-analysis. Front. Psychiatry14, 1138205 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 85.Gibson-Smith, D. et al. Association of food groups with depression and anxiety disorders. Eur. J. Nutr.59, 767–778 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 86.Sharpley, C. et al. Pet ownership and symptoms of depression: A prospective study of older adults. J. Affect. Disord.264, 35–39 (2020). [DOI] [PubMed] [Google Scholar]
  • 87.Pine, R., Fleming, T., McCallum, S. & Sutcliffe, K. The effects of casual videogames on anxiety, depression, stress, and low mood: a systematic review. Games Health J.10.1089/g4h.2019.0132 (2020). [DOI] [PubMed]
  • 88.Russoniello, C. V., Fish, M. T. & O’Brien, K. The efficacy of playing videogames compared with antidepressants in reducing treatment-resistant symptoms of depression. Games Health J.8, 332–338 (2019). [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The dataset, containing the tweet-ids of posts by depressed users, used for this study can be obtained from the corresponding author on request.


Articles from NPJ Mental Health Research are provided here courtesy of Nature Publishing Group

RESOURCES