Ggplot2, PubMed citation frequency and DSM-IV Axis I disorders by year

March 31, 2012


I an earlier post I used ggplot2 to plot publication count by year for different psychotherapy orientations. I’m using an updated version of that R-code in this post to plot publication count for several major DSM-IV disorders. It’s basically like a very simple discourse analysis.

The search string

I searched for the following disorders: Depression, Bipolar disorder, Post-Traumatic Stress Disorder (PTSD), Attention-Deficit/Hyperactivity Disorder (ADHD), Obsessive-Compulsive Disorder (OCD), Anorexia nervosa, Bulimia nervosa, Social phobia, Panic disorder, Generalized anxiety disorder (GAD), Borderline personality disorder, Agoraphobia and Specific phobia. The following PubMed queries were used:

PubMed Search String

  • Depression[Title/Abstract] (186815 hits)
  • Bipolar disorder[Title/Abstract] (12341 hits)
  • Post-Traumatic Stress Disorder[Title/Abstract] (4294 hits)
  • Attention-Deficit/Hyperactivity Disorder[Title/Abstract] (5121 hits)
  • Obsessive-Compulsive Disorder[Title/Abstract] (7172 hits)
  • Anorexia nervosa[Title/Abstract] (8634 hits)
  • Bulimia nervosa[Title/Abstract] (3547 hits)
  • “Social phobia” OR “social anxiety disorder”[Title/Abstract] (3418 hits)
  • “Panic disorder” OR “panic attack”[Title/Abstract] (8542 hits)
  • Generalized anxiety disorder[Title/Abstract] (2965 hits)
  • Borderline personality disorder[Title/Abstract] (3116 hits)
  • Agoraphobia[Title/Abstract] (2352 hits)
  • Specific phobia[Title/Abstract] (424 hits)

Results — the plots

Number of PubMed hits per year and DSM-IV diagnosis. By Kristoffer Magnusson

Figure 1. ggplot with DSM-IV Axis 1 disorders PubMed publication count by year.

Depression removed and plot zoomed in.
Number of PubMed hits per year and DSM-IV diagnosis. Depression removed. By Kristoffer Magnusson

Figure 1. ggplot with DSM-IV Axis 1 disorders PubMed publication count by year (depression removed).


The word depression is really mentioned much much more often than the other disorders in articles title/abstracts. Among the other disorders there seem to be that some disorders have become more popular in the last decade. Bipolar disorder, PTSD, ADHD and OCD seem to have gotten some extra attention compared to the remaining disorders. Especially bipolar disorder appear to really have become the “it” diagnosis in the last decade. From what I’ve heard from psychologists and psychiatrists working in the swedish psychiatry there seem to be some validity to this conclusion.

Changes to the R code

I made some changes to the R code since. Since I’m importing and reading publication year from individual data files for each disorder, I changed the code to bind each new disorder to the previous one, generating one variable in long format. It would have made a lot of redundant code to plot each disorder on it’s own ggplot2-layer. I also updated the scrape.pubmed()-function to now accept two arguments, where I specified disorder and disorder type (like mood disorder or anxiety disorder). Another change is that I’m now using direct.label() to remove the legend from ggplot and add labels direct to the plot.

The actual code used

Written by Kristoffer Magnusson a researcher in clinical psychology. You should follow him on Twitter and come hang out on the friendliest open science discord Git Gud Science.


Published March 31, 2012 (View on GitHub)