Materials and Methods ::: Data and sample construction	Using the Twitter Application Program Interface (API) and the IUNI OSoMe (a service which provides searchable access to the Twitter “Gardenhose”, a 10% sample of all daily tweets), we search for tweets that matched both “diagnos*” and “depress*.” The resulting set of tweets are then filtered for matching the expressions “i”, “diagnos*”, “depres*” in that order in a case-insensitive manner allowing insertions to match the greatest variety of diagnosis statements, e.g. a tweet that states “I was in fact just diagnosed with clinical depression” would match. Finally, to ensure we are only including true self-referential statements of a depression diagnosis, a team of 3 experts manually removed quotes, jokes, and external references. For each qualifying diagnosis tweet we retrieve the timeline of the corresponding Twitter user using the Twitter user_timeline API endpoint . Subsequently, we remove all non-English tweets (Twitter API machine-detected“lang” field), all retweets, and tweets that contain “diagnos*” or “depress*”, but not a valid diagnosis statement.

Introduction ::: Depressed and random sample	We identified a cohort of social media users that had self-reported a clinical diagnosis of depression by posting a variant of the explicit statement “I was diagnosed with depression” (see “Materials and Methods”). To make sure we were only including truly self-referential statements of diagnosis of depression, 3 of the authors manually removed quotes, retweets, jokes, and external references. Note that we exclude all diagnosis statements themselves from our analysis, including all tweets that contain the term “diagnos” and “depress”. We also examine the sensitivity of our results to the propensity of this cohort to make similar self-referential statements (see “Absence of personal pronoun effect.”) With this final set of adjudicated diagnosis tweets, we harvested the maximum number of tweets allowed by the Twitter API (the most recent 3200) for each individual, resulting in a sample of 1,207 users and their 1,759,644 tweets (ranging from May 2008 to September 2018). We refer to this cohort as “Depressed”, but acknowledge that we have no independent confirmation of their present mental health state.

The resulting Depressed cohort contains 1,207 individuals and 1,759,644 tweets ranging from from May 2008 to September 2018. To compare CDS prevalence rates of the Depressed cohort to a baseline, we construct a Random Sample cohort of individuals. To do so, we collect a large sample of random tweets in 3 weeks (i.e. September 1-8, 2017, March 1-8, 2018, and September 1-8, 2018) from the IUNI OSOME. We extract all Twitter user identifiers from these tweets (N=588,356), and retain only those that specified their geographical location and were not already included in our Depressed cohort. To equalize platform, interface, and behavioral changes over time, we select a sub-sample of these individuals such that the distribution of their account creation dates matches those of the Depressed cohort, resulting in an initial set of 9,525 random individuals. Finally, we harvested the Twitter timelines of these users and filtered the obtained data in the same way as described for the Depressed cohort.

Our results suggest a path for mitigation and intervention, including applications that engage individuals suffering from mood disorders such as major depressive disorder via social media platforms and that challenge particular expressions and types of depressogenic language. Future characterizations of the relations between depressogenic language and mood may aid in the development of automated interventions (e.g., “chatbots”) or suggest promising targets for psychotherapy. Another approach that has shown promise in leveraging social media for the treatment of mental health problems involves “crowdsourcing” the responses to cognitively-distorted content. Several limitations of our theory-driven approach should be considered. First, we rely on self-reported depression diagnoses on social media which have not been independently verified by a clinician. However, the potential inaccuracy of this inclusion criterion would reduce the observed effect sizes (PR values between cohorts) due to the larger heterogeneity of our cohorts. Consequently, our results are likely not an artifact of the accuracy of our inclusion criterion. Second, our lexicon of CDS was composed and approved by a panel of 9 experts who may have been only partially successful in capturing all n-grams used to express distorted ways of thinking.

Nevertheless, a significant portion of CDS in our set did not occur in our collections of Twitter content, indicating the scope of our lexicon exceeds that of common online language. On a related note, the use of CDS n-grams implies that we measure distorted thinking by proxy, namely via language, and our observations may be therefore be affected by linguistic and cultural factors. Common idiosyncratic or idiomatic expressions may syntactically represent a distorted form of thinking, but no longer do in practice. For example, an expression such as “literally the worst” may be commonly emphloyed to express dismay, without necessarily involving the speaker experiencing a distorted mode of thinking. Third, both cohorts were sampled from Twitter, a leading social media platform, whose use may be associated with higher levels of psychopathology and reduced well-being, , . We may thus be observing elevated or biased rates of distorted thinking in both cohorts as a result of platform effects. However, we report relative prevalence numbers with respect to a carefully construed random sample, which likely compensates for this effect. Furthermore, recent analysis indicates that representative samples with respect to psychological phenomena can be obtained from social media content.

fig:Vader ScoresA shows the VADER sentiment distribution of only CDS n-grams with non-zero ratings. Here we observe only a slight negative skew of CDS sentiment for this small minority of CDS n-grams (24.1%). Furthermore, as shown in fig:Vader ScoresB, the sentiment distributions of all tweets for the Depressed and Random Sample cohorts are both skewed towards positive sentiment (right side of distribution). This matches earlier findings that human language exhibits a so-called Polyanna effect, a near-universal phenomenon that skews human language towards positive valence. Surprisingly, we find no indications that the tweets of the Depressed cohort carry more negative valence than those of the Random Sample cohort. To the contrary, VADER sentiment ratings in the range $[0.70,1.00]$ seem to be slightly more prevalent among the tweets of the Depressed cohort (see fig:Vader ScoresB), possibly indicating an increased emotionality (higher levels of both negative and positive affect).

Results from a Two-Sample Kolmogorov–Smirnov test ($p < 0.0001$) indicate that we can reject the null hypothesis that the two samples are drawn from the same distribution. Furthermore, we conduct a between-groups analysis to compare the prevalence of CDS between the Depressed vs. the Random Sample cohort. We do so by calculating the Prevalence of CDS for all tweets from each cohort and calculating the Prevalence Ratio ($PR$) between the two cohorts (see Materials and Methods “Prevalence Ratio”). A Prevalence Ratio significantly larger than 1 indicates that the presence of CDS in the tweets written by the Depressed cohort is greater than the Random Sample cohort. To assess the sensitivity of our results to changes in our cohort samples, we repeatedly calculate the estimated $PR$ value over 10,000 random re-samples (with replacement) of both groups, resulting in a distribution of PR values shown in fig:All CD Categories (see Materials and Methods “Bootstrapping”). Note, Prevalence Ratios express the relative difference between the 2 cohorts, not the absolute difference which is provided in Appendix Table 6.

Depressed individuals express more distorted thinking on social media	Depression is a leading cause of disability worldwide, but is often under-diagnosed and under-treated. One of the tenets of cognitive-behavioral therapy (CBT) is that individuals who are depressed exhibit distorted modes of thinking, so-called cognitive distortions, which can negatively affect their emotions and motivation. Here, we show that individuals with a self-reported diagnosis of depression on social media express higher levels of distorted thinking than a random sample. Some types of distorted thinking were found to be more than twice as prevalent in our depressed cohort, in particular Personalizing and Emotional Reasoning. This effect is specific to the distorted content of the expression and can not be explained by the presence of specific topics, sentiment, or first-person pronouns. Our results point towards the detection, and possibly mitigation, of patterns of online language that are generally deemed depressogenic. They may also provide insight into recent observations that social media usage can have a negative impact on mental health.

We observe in fig:All CD Categories that the median of this distribution of PR values is significantly larger than 1 (and its 95% confidence intervals does not include 1), indicating that we find a statistically significant higher prevalence of CDS in the Depressed cohort ($1.2\times $) than in the Random Sample, and that this result is robust to random changes in our cohorts. The between-groups PR values shown in fig:All CD Categories do not reflect specific distortion types; all CDS are equally and independently matched to all tweets. Total CDS prevalence over all tweets is 21.8% and 18.407% for the Depressed and Random Sample cohort respectively but differs significantly for each CD type (See Appendix Table 5). It is reasonable to expect that the different types of CDS may differ in their prevalence between our cohorts. We therefore repeat the above analysis, with CDS separated by CD type (see table:CDclasses).

This process often entails a series of conversations with the client to uncover and address statements that reflect these so-called Cogntive Distortions (CD). The idea that language is predictive of depression is supported by data-driven approaches detecting depression from various lexical markers including the use of language to describe negative emotions, , the use of first-person pronouns, , , , and mentions of common symptoms. Machine learning approaches have been shown to successfully predict whether Facebook users suffer from depression, , identifying the most useful lexical markers to render a prediction. These results, while useful for prediction and the detection of depression, do not offer insights into the cognitive dynamics of the disease pattern, nor its relationship to language, which is crucial in developing treatments and interventions. Here, we emphloy a theory-driven approach to studying depressive language on Twitter. Rather than attemphting to extract relevant text features from text data, e.g. “sleep”, “health”, or other mental health related features, we define a clinical lexicon of 241 n-grams that a panel of clinical psychologists deemed to form a schema involved in the expression of a particular type of distorted thinking according to CBT theory and practice.

Where possible, higher-order n-grams were chosen to capture as much of the semantic structure of one or more distorted schemata as possible, e.g. the 3-gram “everyone will believe” captures both Overgeneralizing and Mindreading. We did include 1-grams such as “nobody” and “everybody” in spite of their prevalence in common language, since they strongly correspond to the expression of Dichotomous Reasoning. table:CDclasses shows the number of schemata per category in our CDS set along with the average n-gram size, and a number of relevant grammatical features. The complete set of CD schemata is provided in Table 7 in the Appendix. We note that a significant sub-set of the CDS do not occur in the Twitter content for both cohorts (see table:CDclasses: $N_\exists $), indicating that parts of our set of CDS are “lexically exhaustive” with respect to capturing the major modes of CD expression in natural language.

Results ::: Robustness to CDS changes	To determine the sensitivity of our results to the particular choice of CDS, we re-calculated PR values between the Depressed and Random Sample cohorts, but instead of re-sampling our Depressed and Random Sample cohort, we randomly re-sampled (with replacement) the set of 241 CDS n-gram. The 95% CI of the resulting distribution of PR values then indicates how sensitive our results are to random changes of our CDS set. The results of this analysis are shown in table:CDCategoryPrevalence: PR$_C$. We observe slight changes in the dispersion of the resulting distribution of PR values, but the median values and 95% CIs remain largely unchanged. As before, the 95% CIs continue to exclude $1.000$ for all CD types, except Mindreading, Should Statements, Fortune-telling, and Catastrophizing, and we can continue to reject the null-hypothesis that PR values are similar between the Depressed and Random Sample cohort for nearly all CD types.

Results ::: Absence of personal pronoun effect	Research has shown that First-Person Pronouns (FPP) are more prevalent in the language of depressed individuals, . Since many CDS contain FPPs (see table:CDclasses “Pronouns”), our results may to a degree reflect this phenomenon instead of the “distorted” nature of our CDS. To test the sensitivity of our results to the presence of FPPs in our set of CDS, we repeat our analysis entirely without CDS that contain the FPPs “I” (upper-case), “me”, “my”, “mine”, and “myself”. As shown in table:CDCategoryPrevalence: PR$_1$, we find that their removal does not significantly alter the observed effect. The respective confidence intervals resulting from our removal of FPP schemata change, but most overlap with those obtained from an analysis that includes the full set of CDS (see table:CDCategoryPrevalence: PR$_A$ vs table:CDCategoryPrevalence: PR$_1$). This demonstrates that our observations are not a product of the presence of first-person pronouns in our set of CDS.

Results ::: Absence of sentiment effect	Previous research has shown that the language of depressed individuals is less positive (lower text valence) and contains higher levels of self-referential language, , , , , . To determine the degree to which our results can be explained by text sentiment or self-referential statements instead of distorted thinking, we examine the valence loadings of our collection of tweets and CDS, and reproduce our results with and without CDS containing self-referential statements. First, we determine the valence values of each CDS n-gram in our set using the VADER sentiment analysis tool which in a recent survey was shown to outperform other available sentiment analysis tools for social media language. VADER is particularly appropriate for this use, since its sentiment ratings take into account grammatical context, such as negation, hedging, and boosting. We find that 75.9% of our CDS have either no sentiment-loaded content or are rated to have zero valence (neutral sentiment scores). The average valence rating of all CDS is $-0.05 (N=241)$ on a scale from $-1.0$ to $+1.0$.

Materials and Methods ::: Bootstrapping estimates	The estimated Prevalence and Prevalence Ratio can vary with the particular composition of either our set $C$ (CDS n-grams) or the set of individuals in our Depressed and Random Sample cohorts, respectively $D$ and $R$. We verify the reliability of our results by randomly re-sampling either $C$ or both $D$ and $R$, with replacement. This is repeated $B = 10000$ number of times, leading to a set of re-sampled CD sets or cohort samples. Each of these $B$ number of re-samples of either (1) the set of CDS $C$ or (2) or the sets $D$ and $C$ of all individuals in our Depressed and Random Sample cohorts results in $B$ number of corresponding Prevalence or Prevalence Ratio values: The distributions of $P^*$ and $PR^*$ are then characterized by their median ($\mu _{50}$) and their 95% confidence interval ($[\mu _{2.5}, \mu _{97.5}]$).

Furthermore, as shown in table:CDCategoryPrevalence, the 95% CIs of PR$_C$ and PR$_A$ largely overlap across all CD types indicating our results are robust to random changes of our cohort samples as well as our CDS set.

For example, “I will never _” would be implicated in the expression of a cognitive distortions such as Catastrophizing or Fortune-telling, whereas “I am a _” would be used to express a Labeling and Mislabeling distortion. We then compare the longitudinal prevalence of this set of Cognitive Distortion Schemata (CDS) in the language of a large cohort of depressed individuals vs. a random sample on social media (Twitter). Our results indicate significantly higher prevalence of most types of CDS in the Depressed cohort, both at the within-subjects and between-groups level. Particularly CDS in the Personalizing and Emotional Reasoning types occur approximately 2.3 times more frequently in the online language of Depressed users. Our results are robust to changes in our user sample, our choice of CDS n-grams, text sentiment, and the known propensity of Depressed individuals to make self-referential statements.

Results	We first compare the within-subject prevalence of the established set of CDS between the Depressed and Random Sample cohorts. For each individual we count how many of their tweets contained any of the 241 CDS and divide it by their total number of tweets, resulting in an individual within-subject CD prevalence (see “Materials and Methods”). The density distribution of individual prevalence values can then be compared between Depressed and Random Sample individuals as shown in fig:User Ratio. We restrict this analysis to individuals with at least 150 tweets so that we have sufficient data to determine prevalence reliably, but retain all individuals in subsequent between-groups analyses since the latter does not require the calculation of within-subject prevalence values. We observe that the distribution of within-subject CDS prevalence is shifted significantly to the right for the Depressed cohort relative to that of the Random Sample, indicating that individuals in the Depressed cohort express significantly more CDS. Note that $0.487$% of the Random Sample individuals have no tweets with CDS whereas the Depressed sample has no cases without CDS.

Since some user data was found to be no longer publicly available and others have no tweets left after our filters, our final Random Sample Cohort consists of 8,791 individuals and a total 8,498,574 tweets. The code and data used in this analysis are freely available at https://github.com/kbathina/CDs_Depressed_Twitter. Upon reasonable request we will provide all Twitter user IDs and tweet IDs to reproduce our results.

Of note, our findings are not explained by the use of first-person pronouns or more negatively loaded language, both of which had been identified in past research as markers of depressed individuals. These results shed a light on how depression may affect public discourse on social media, but also reveals the degree to which depressogenic language is manifested in the colloquial language of social media platforms. This is of social relevance given that these platforms are specifically designed to propagate information through the social ties that connect individuals on a global scale. An advantage of studying theory-driven differences between the language of depressed and non-depressed individuals, as opposed to a purely data-driven or machine learning approach, is that we can explicitly use the principles underpinning CBT to understand the cognitive and lexical components that may shape depression. Cognitive behavioral therapists have developed a set of strategies to challenge the distorted thinking that is characteristic of depression. Preliminary findings suggest that specific language can be related to specific therapeutic practices and seems to be related to outcomes. These practices, however, have largely been shaped by a clinical understanding and not necessarily informed by objective measures of how patterns of language can determine the path of recovery.

Introduction ::: Cognitive distortion types and n-gram schemata	Aaron T. Beck introduced the concept of cognitive distortions to characterize the thinking of individuals with depression, . Subsequently, other clinicians expanded on his typology of distortions, including most recently his daughter, clinical psychologist and CBT expert, Judith Beck. We drew upon these latest lists to identify 12 types of cognitive distortions that may characterize the thinking of individuals who are depressed. We defined 241 CDS n-grams in total, each expressing at least 1 type of cognitive distortion (see Appendix Table 7). The schemata in each category were formulated to capture the “minimal semantic building blocks” of expressing distorted thinking for the particular type, avoiding expressions that are specific to a depression-related topics, such as poor sleep or health issues. For example, the 3-gram “I am a” was included as a building block of expressing Labeling and Mislabeling, because it would be a highly likely (and nearly unavoidable) n-gram to express many self-referential (“I”) expressions of labeling (“am a”) (for an example see table:CDdefinitions).

We also established a baseline sample of randomly chosen individuals with a similar distribution of account creation dates as the Depressed cohort to account for changes in user behavior and platform effects. Here too we exclude all tweets that contain the terms “diagnos” and “depress” from subsequent analysis. Our “Random Sample” cohort contains 8,791 individuals and a total 8,498,574 tweets (see “Materials and Methods”).

Acknowledgements	We thank Luis M. Rocha for his feedback on the general methodology and terminology, as well as Drs. Keith Dobson, Rob DeRubeis, Christian Webb, Stephan Hoffman, Nikolaos Kazantzis, Judy Garber, and Robin Jarrett for their feedback on the content of our list of CDS. Johan Bollen thanks NSF grant #SMA/SME1636636, the Indiana University “Grand Challenges - Prepared for Environmental Change" PR-IUB grant, Wageningen University, and the ISI Foundation for their support.

As shown in table:CDCategoryPrevalence and fig:Separated CD Categories, the prevalence of CDS is significantly higher for nearly all CD types in the tweets of the Depressed cohort than those of the Random Sample with Prevalence Ratio values ranging from $2.4\times $ to $1.1\times $, with the exception of Catastrophizing and Fortune-telling, with the latter not producing a PR significantly different from parity. The CD types Personalizing and Emotional Reasoning have the greatest PR values of $2.4\times $ and $2.3\times $, followed by Overgeneralizing ($1.6\times $), Mental Filtering ($1.5\times $), Labeling and Mislabeling ($1.3\times $), and Disqualifying the positive ($1.3\times $). The CD types Mind Reading, Should Statements, and Magnification and Minimization have lower yet significant PR values of $1.1\times $. table:CDclasses “Significant N” shows the number and ratios of schemata for each CD type that have PR values significantly different from parity. The PR individual CDS n-grams can differ significantly as well.

Appendix Fig. 6 shows the contributions of each individual CDS n-gram separately. table:top10CDS shows the CDS with the individually highest and lowest PR values to illustrate the CDS that are most prevalent in the Depressed and Random Sample cohort respectively. As shown, the highest ranked CDS for the Depressed cohort belong to the Mindreading, Emotional Reasoning, and Personalizing type, whereas the highest ranked CDS for the Random Sample belong to the non-reflexive Mindreading and Fortune-telling type.

One particular deviation in the sentiment range of $[0.40,0.45]$ was found to be uniquely associated with the Random Sample cohort using the “Face With Tears of Joy” emoji (VADER sentiment=0.4404) more often than the Depressed cohort. A two-sample K–S test allows us to reject the null-hypothesis that the two distributions are drawn from the same sample ($p<0.0001$). Combined, these findings strongly suggest that the higher prevalence of CDS in the language of the Depressed cohort can neither be attributed to a negative valence skew in the CDS set, nor the sentiment distribution of the tweets produced by either the Depressed and Random Sample cohorts.

A 95% confidence interval of a PR that does not contain 1 is held to indicate a significant difference in prevalence between the two cohorts.

Note that we could not determine any values for Personalizing because its CDS all contain first-person pronouns (see Appendix Fig. 5).

Discussion	In an online sample of individuals, we emphloyed a theory-driven approach to measure linguistic markers that may indicate cognitive vulnerability to depression, according to CBT theory. We defined a set of Cognitive Distortion Schemata (CDS) that we grouped along 12 widely accepted types of distorted thinking and compared their prevalence between two cohorts of Twitter users: one of individuals who self-identified as having received a clinical diagnosis of depression and the other a similar random sample. As hypothesized, the Depressed cohort use significantly more CDS of distorted thinking in their online language than the Random Sample, particularly schemata associated with Personalizing and Emotional Reasoning. We observed significantly elevated levels of CDS across nearly all CD types, sometimes more than twice as much, but did not find a statistically significant elevated prevalance among the Depressed cohort for two specific types, namely Fortune-telling and Catastrophizing. This may be due to the difficulty of capturing these specific cognitive distortions in the form of a set of 1 to 5-grams as their expression in language can involve an interactive process of conversation and interpretation.

This is an important discussion in computational social science that will continue to be investigated. Data-driven approaches that analyze natural language in real-time will continue to complement theory-driven work such as ours.

Materials and Methods ::: Prevalence Ratios	For each Twitter user $u$ in our sample, we retrieved a timeline $T_u$ of their time-ordered $k$ most recent tweets, $T_u=\lbrace t_1, t_2, \cdots , t_k\rbrace $. We also defined a set $C = \lbrace c_1, c_2, \cdots , c_N\rbrace $ of n-grams where $N=241$ (see table:CDclasses) with varying $n \in [1,5]$ number of terms. The elements of set C are intended to represent the lexical building blocks of expressing cognitive distortions (see table:CDclasses and Appendix Table 7). We introduce a CDS matching function $\mathcal {F}_C(t) \rightarrow \lbrace 0,1\rbrace $, which maps each individual tweet $t$ to either 0 or 1 according to whether a tweet $t$ contains one or more of the schemata in set $C$. Note that the range of $\mathcal {F}_C(t)$ is binary, thus a tweet that contains more than one CDS still counts as 1.

The within-subject prevalence of tweets for individual $u$ is defined as the ratio of tweets that contain a CDS in $C$ over all tweets in their timeline $T_u$: Our sample is separated into two cohorts: one of 1,207 Depressed and another of 8,791 Random Sample individuals. We denote the set of all individuals in the depressed cohort $D = \lbrace u_1, u_2, \cdots , u_{1207}\rbrace $ and random sample cohort $R = \lbrace u_1, u_2, \cdots , u_{8791}\rbrace $. Hence, the sets of all tweets written by users in the Depressed and Random Sample cohorts are defined as: We can then define the Prevalence ($P$) of tweets with CDS $C$ for each the Depressed ($D$) and Random Sample ($RS$) cohorts as follows: or, informally, the ratio of tweets that contain any CDS over all tweets written by the individuals of that cohort.

Consequently, the Prevalence Ratio ($PR$) of CDS in set $C$ between the two cohorts $D$ and $R$, denoted $PR_C(D,R)$, is defined simply as the ratio of their respective CDS prevalence $P_C(T_D)$ and $P_C(T_R)$ in the tweet sets $T_D$ and $T_r$ respectively: If $PR_C(D,R) \simeq 1$ the prevalence of CDS in the tweets of the depression cohort are comparable to their prevalence in the tweets of the random sample. However, any value $PR_C(D,R) \ll 1$ or $PR_C(D,R) \gg 1$ may indicate a significantly higher prevalence in each respective cohort. Here we use $\gg 1$ and $\ll 1$ to signifiy that a PR value is significantly higher or lower than 1 respectively, which we asses by whether its 95% CI includes 1 or not (see Bootstrapping below).

Introduction	Depression is a leading contributor to the burden of disability worldwide, , with some evidence that disability attributed to depression is rising, particularly among youth, . A key challenge in reducing the prevalence of depression has been that it is often under-recognized as well as under-treated. Cognitive-behavioral therapy (CBT), is the most widely researched psychotherapy for depression. It is equivalent to antidepressant medications in its short-term efficacy and evidences superior outcomes in the long-term, . The cognitive theory underlying CBT argues that the ways in which individuals process and interpret information about themselves and their world is directly related to the onset, maintenance, and recurrence of their depression, . This model is consistent with information processing accounts of mood regulation and its dynamics, as well as basic research that supports the role of cognitive reappraisal and language in emotion regulation, , , . In CBT, therapists work with their clients to identify depressogenic thinking patterns by identifying lexical or verbal markers of rigid, distorted, or overly negative interpretations, . For example, statements that include “should” or “must” are often challenged as reflecting overly rigid rules about the world (“I shouldn't be lazy”, “I must never fail”).

Question: Do they report results only on English datasets?
Answer: Yes