Algorithm Uses Facebook Posts to Predict Later Depression

November 1, 2018

Through a scan of social media posts, an algorithm was able to predict which individuals were later diagnosed with depression, according to a study published online in the Proceedings of the National Academy of Sciences of the United States of America.

“There’s a perception that using social media is not good for one’s mental health, but it may turn out to be an important tool for diagnosing, monitoring, and eventually treating it,” said senior author H. Andrew Schwartz, PhD, an assistant professor in the computer science department at Stony Brook University, Stony Brook, New York.

The study included 683 patients who visited the emergency department of a large urban academic center, 114 of whom had a depression diagnosis. All participants consented to share their Facebook statuses and medical record information.

Could Facebook Data Revolutionize Mental Health Care?

Using only language in Facebook posts preceding medical record documentation of depression, if any, the algorithm was able to identify patients later diagnosed with depression with accuracy similar to that with screening surveys. Significant prediction of a future depression diagnosis was possible as far as 3 months preceding diagnosis.

Language that predicted depression, according to the study, referenced typical symptoms, such as sadness, loneliness, hostility, rumination, and increased self-reference as indicated by use of more first-person pronouns such as “I” and “me.”

“Depression appears to be something quite detectable in this way; it really changes people’s use of social media in a way that something like skin disease or diabetes doesn’t,” said Johannes C. Eichstaedt, PhD, postdoctoral fellow at the University of Pennsylvania, Philadelphia.

“The hope is that one day these screening systems can be integrated into systems of care. This tool raises yellow flags; eventually, the hope is that you could directly funnel people it identifies into scalable treatment modalities.”

—Jolynn Tumolo


Eichstaedt JC, Smith RJ, Merchant RM, et al. Facebook language predicts depression in medical records. Proceedings of the National Academy of Sciences of the United States of America. 2018 October 15;[Epub ahead of print].

Linguistic red flags from Facebook posts can predict future depression diagnoses [press release]. Stony Brook, New York: Stony Brook University; October 19, 2018