Analyzing hospitalization rate, treatment switch, and effectiveness between two MDD drugs

April 29, 2022

Major depressive disorder (MDD) is one of the most prevalent psychiatric disorders globally [1]. It is a multifactorial disease characterized by severe changes in a person’s mood, interests, and cognition [2]. Patients diagnosed with this disease show at least one discrete depressive episode lasting at least 2 weeks and present diminished mood, anhedonia, and lack of energy among other symptoms [2,3].

Antidepressant medications for MDD are grouped using the Neuroscience-based Nomenclature into 4 groups: selective serotonin reuptake inhibitors (SSRIs), serotonin and norepinephrine reuptake inhibitors (SNRIs), monoamine oxidase inhibitors (MAOI), and tricyclic antidepressants (TCA) [4]. SSRIs are generally the first line of treatment for MDD [5].

Developing new treatments in the pharmaceuticals and life sciences industries is a time consuming and costly process. A new drug takes on average nine years to be clinically developed [6]. In this context, real-world data (RWD) open multiple possibilities in the drug development and approval process, including supporting regulatory and off-label approval, discovering novel side effects, and conducting comparative effectiveness research [7].

At Holmusk, we have one of the largest longitudinal real-world behavioral health databases, encompassing more than 920,000 patients and over 75 million rows of drug and diagnostic data. Together with NeuroBlu’s integrated Code Studio (R/Python) interface, advanced analytics packages, and built-in code libraries, we can evaluate the effectiveness of a determined drug among real-world patients. This provides high impact insights to support the process of drug approval.

In this use case, we will showcase how to utilize custom Python/R templates in NeuroBlu to evaluate the effectiveness of two of the most commonly prescribed drugs for MDD - fluoxetine and citalopram. For this use case, the index date will be the first date of drug prescription. Drug effectiveness will be evaluated based on two measurements: Psychiatric hospitalizations and the Clinical Global Impressions-Severity (CGI-S). To achieve this, we will perform the following steps on NeuroBlu:

  1. Obtain and save the ICD codes for major depressive disorder.
  2. Run the configurable script code.
  3. Export and analyze results.

1. Obtain and save the ICD codes for major depressive disorder

In NeuroBlu, diagnoses are recorded using ICD-9-CM and ICD-10-CM codes. We provide a graphical user interface, called Category Mapper, that helps to group values (e.g. ICD diagnosis codes) to create custom categories. These custom categories can be referenced across multiple projects, thus eliminating boilerplate code for creating the categories and mappings every time in each individual project. Besides that, Category Mapper contains template projects, which can be easily duplicated to accelerate research.

For this use case, we will duplicate the ‘Example Diagnosis Mappings’ template which includes the most common psychiatric disorders, including major depressive disorder:

We will also duplicate the ‘Example Drugs Mappings’ template which groups drugs into categories, such as Antidepressants, Antipsychotics, etc.:

2. Run the configurable script code

In NeuroBlu, we provide users with configurable and commented scripts in both Python and R languages. For this use case, we will first duplicate the template “Cohort Characteristics & Drug Comparison”.

With the in-built scripts, users only have to change certain parameters before running the code to obtain the desired analysis. In this use case, we need to change the following parameters before running the code:

  • diagnosis_category_mapper: Name of the diagnosis category mapper that was built in the first section of this use case.
  • diagnosis_category_name: Name of the disorder that we want to analyze. In this use case, we will indicate as “Major depressive disorder”.
  • drug_category_mapper: Name of the drug category mapper that was built in the first section of this use case.
  • drug_name_1 and drug_name_2: Names of the drugs to be compared. In this use case, we will use fluoxetine and citalopram.
  • min_days_drug: Minimum duration (in days) for the drugs to be considered in the analysis. We will set it to 30 days.
  • win_days: Time window (in days) for finding CGI-S at index and end time points. In this use case, we will set it to 7 days.
  • baseline_CGIS: Average CGI-S within +/- win_days at the index date required for a patient to be included in the analysis. In this use case, we will set it to 4.
  • period_days_study: Period of study (in days), to calculate the end of the study from index date. We will set it to 365 days in this use case.
  • cohort_balance_flag: Specifies whether to perform cohort balancing before analysis. We will set it to FALSE in this use case.

After changing these parameters, run the code to visualize the results.

3. Export and analyze results

The second output of the script shows the percentage of patients hospitalized by each drug type. In this result, we observe that the percentage of hospitalization and non-hospitalization is similar for both drugs.

The third output is a descriptive statistics table summarizing the demographic variables, duration of prescriptions, and the CGI-S baseline for patients in each group. We observe that patients prescribed citalopram were significantly older as compared to those prescribed fluoxetine (42.2 vs 36.6 years).

The barplot below shows the distribution of difference in CGI-S between the start and end dates of the study. For example, a 0 would mean that the patient did not show an improvement in CGI-S at the end of the study, whereas a positive value represents a worsening in CGI-S. The code also calculates the percentage of patients who showed an improvement for both drugs. In this case, we observe that 39.7% of patients treated with fluoxetine showed at least 1 unit improvement in CGI-S at the end of the study, compared to 35.9% of the patients treated with citalopram.

Finally, the last output is a sankey plot showing the proportion of patients for each drug that were hospitalized, the most frequent treatment switch, as well as change in CGI-S at the end of the study. Interestingly, the results show that hospitalized patients did not have a treatment switch. On the other hand, we observed that when assessing change in CGI-S, the proportion of patients who did not have a treatment switch and who had a worse CGI-S at the end of the study was slightly higher in those who were prescribed fluoxetine.


In this use case, we showcased how to use a configurable script with inclusion and exclusion criteria to select a subset of MDD patients for custom analysis. When comparing the differences in CGI-S for MDD patients treated with fluoxetine and citalopram, we found a higher proportion of patients who improved in CGI-S when treated with fluoxetine as compared to citalopram. Besides comparing clinical outcomes, we also illustrated how to utilize NeuroBlu to visualize medication switch patterns. Upon analysing the ratio of hospitalizations, we observed that hospitalized patients did not present a change in treatment during the period studied.


  1. Villanueva, R. (2013). Neurobiology of Major Depressive Disorder. Neural Plasticity, 2013.
  2. Otte, C., Gold, S. M., Penninx, B. W., Pariante, C. M., Etkin, A., Fava, M., Mohr, D. C., & Schatzberg, A. F. (2016). Major depressive disorder. Nature Reviews Disease Primers 2016 2:1, 2(1), 1–20.
  3. Bains, N., & Abdijadid, S. (2021). Major Depressive Disorder. Major Depressive Disorder, 1–189.
  4. Zohar, J., Stahl, S., Moller, H. J., Blier, P., Kupfer, D., Yamawaki, S., Uchida, H., Spedding, M., Goodwin, G. M., & Nutt, D. (2015). A review of the current nomenclature for psychotropic agents and an introduction to the Neuroscience-based Nomenclature. European Neuropsychopharmacology : The Journal of the European College of Neuropsychopharmacology, 25(12), 2318–2325.
  5. Carty, J. J., Jr, & Escalona, P. R. (2016). Brief Review of Major Depressive Disorder for Primary Care Providers. Federal Practitioner, 33(Suppl 2), 12S.
  6. Brown, D. G., Wobst, H. J., Kapoor, A., Kenna, L. A., & Southall, N. (2021). Clinical development times for innovative drugs. Nature Reviews Drug Discovery.
  7. Rudrapatna, V. A., & Butte, A. J. (2020). Opportunities and challenges in using real-world data for health care. The Journal of Clinical Investigation, 130(2), 565.

Back to top
Contact us