code written: 2020-01-07
last ran: 2020-01-12
website: http://rpubs.com/navona/SPINS_medications


Notes: This script parses the psychotropic medication data for the n=250 SPINS SSD participants eligible for my thesis project. The values in the tables and visualizations show \(mg\)/QD, even if the medication was not administered QD (i.e., all values have been converted to a “daily-dose” time scale). PRN medications are not presented here. Missing values have been estimated. All drugs are presented by their generic name. We have retained information about method of administation (oral, depot) required for CPZE calculation, but that information is not presented here.


PLEASE VERIFY: Recoding of medications.

#make all lower case
df$pmed_drug_name <- tolower(df$pmed_drug_name)

#correct misspellings
df <- df %>% mutate(pmed_drug_name = dplyr::recode(pmed_drug_name,
      `aripiprazole `='aripiprazole', 
      `aripiprazole` ='aripiprazole', 
      `aripiprizole`='aripiprazole',
      `aripiprozole`='aripiprazole', 
      `aripirazole`='aripiprazole',
      `aripiprazole`='aripiprazole',
      `benzotropine`='benztropine',
      `celetron`='celestone',
      `clonazepam `='clonazepam',
      `escitalipram`='escitalopram',
      `geodan`='geodon',
      `haloperidol dec`='haloperidol decanoate',
      `haldol`='haloperidol decanoate',
      `haloperidol`='haloperidol decanoate',
      `hydoxyzine pamoate`='hydroxyzine',
      `hydroxizine`='hydroxyzine',
      `lorezepam`='lorazepam',
      `lurasidone `='lurasidone', 
      `olanzepine`='olanzapine',
      `paliperidone`='paliperidone',
      `palliperidone`='paliperidone',
      `paliperidone `='paliperidone',
      `setraline`='sertraline',
      `thiothizene`='thiothixene',
      `trazadone`='trazodone',
      `trazedone`='trazodone',
      `venlafaxine `='venlafaxine', 
      `vortoxitine`='vortioxetine',
      `ziprazadone`='ziprasidone',
      `ziprazidone`='ziprasidone',
      `zoplicone`='zopiclone'
      ))

#fix inconsistent annotation
df <- df %>% mutate(pmed_drug_name = dplyr::recode(pmed_drug_name,
     `(abilify) aripiprazole` = 'aripiprazole',
     `bupropion hcl` = 'bupropion',
     `bupropion hcl xl` = 'bupropion',
     `bupropion xl` = 'bupropion',
     `buproprion` = 'bupropion',
     `citalopram hydrobromide` = "citalopram",
     `(cogentin) benztropine` = 'benztropine',
     `(depacote) valpronic acid` = 'valproate', 
     `depakote (valproate)` = 'valproate',
     `divalproex` = 'valproate',
     `divalproex sod dr` = 'valproate',
     `divalproex sodium` = 'valproate',
     `divalproex sodium er` = 'valproate',
     `effexor xr` = 'effexor',
     `escitalopram lexapro` = 'escitalopram',
     `haldol dec` = 'haloperidol', 
     `haloperidol (injection)` = 'haloperidol', 
     `haloperidol decanoate` = 'haloperidol',
     `fluanxol capsule` = 'fluanxol', 
     `fluanxol injection` = 'fluanxol',
     `fluphenazine decanoate` = 'fluphenazine',
     `invega sustenna (im)` = 'invega sustenna',
     `novo-fluoxetine` = 'fluoxetine',
     `paliperidone invega sustenna`='paliperidone',
     `paliperidone palmitate`='paliperidone',
     `seroquel ir` = 'quetiapine',
     `seroquel xr` = 'quetiapine',
     `quetiapine (seroquel)` =  'quetiapine',
     `quetiapine seroquel` = 'quetiapine',
     `leuprolide (lupron)` = 'leuprolide acetate', #hormone
     `lithium carbonate` = 'lithium',
     `valproic acid` = 'valproate'
     ))

#brand to generic 
df <- df %>% mutate(pmed_drug_name = dplyr::recode(pmed_drug_name,
     `abilify` = 'aripiprazole',  
     `abilify maintena` = 'aripiprazole',
     `adderall` = 'dextroamphetamine',
     `ativan` = 'lorazepam',
     `benadryl` = 'diphenhydramine',
     `celexa`='citalopram',
     `cipralex` = 'escitalopram', 
     `celestone` = 'betamethasone',
     `cogentin` = 'benztropine',
     `concerta` = 'methylphenidate', 
     `cymbalta` = 'duloxetine',
     `depakote` = 'valproate',
     `effexor` = 'venlafaxine',
     `epival` = 'valproate',
     `fanapt` = 'iloperidone',
     `fluanxol` = 'flupenthixol',
     `geodon` = 'ziprasidone',
     `inderal` = 'propranolol',
     `invega` = 'paliperidone',
     `invega sustenna` = 'paliperidone',
     `klonopin` = 'clonazepam',
     `latuda` = 'lurasidone',
     `lexapro` = 'escitalopram',
     `neuleptil` = 'periciazine',
     `paliperidone` = 'paliperidone',
     `parsitan` = 'ethopropazine',
     `paxil` = 'paroxetine',
     `prozac` = 'fluoxetine',
     `risperdal` = 'risperidone',
     `risperdal consta` = 'risperidone',
     `seroquel` = 'quetiapine',
     `stelazine` = 'trifluoperazine',
     `topamax` = 'topiramate',
     `vyvanse` = 'lisdexamfetamine',
     `wellbutrin` = 'bupropion',
     `zoloft` = 'sertraline',
     `zyprexa` = 'olanzapine'
     ))

Data overview: Data from a potential n=250 SSD participants were available for this analysis. However, n=15 SSD participants were not taking any psychotropic medications at time of study. Before any data cleaning, the sample of n=234 SSD participants taking medication were together taking 532 medications (47 unique).

Data cleaning: N=10 medication observations (n=7 unique: betamethasone, diphenhydramine, hydroxyzine, leuprolide acetate, minocycline, oxybutynin, propranolol) were found to be non-psychotropic, and thus removed from the analysis. We found that a total of n=60 medication observations were missing dosage information and n=2 were missing frequency information. Missing data was replaced in an interative process: (i) If dosage information was missing but frequency information was available, dosage information was replaced with the median value for the given frequency, if possible; (ii) If dosage information was missing and no other observation reported the same frequency, the median value with QD frequency was taken, if available; (iii) If dosage and/or frequency information was missing, the ‘prototypical’ profile across other participants was taken. In total, this method was unable to replace missing data for n=4 unique medication observations (ethopropazine, iloperidone, topiramate, trifluoperazine). These observations/medications were removed from subsequent analyses.

Data included: After data cleaning, data from n=234 participants were included, who cumulatively took n=532 medications (47 unique).


PLEASE VERIFY: Medication table (you can sort and filter and expand).


Note: PRN medications are included here.


The following table displays a cumulative count of medications taken by these included participants (e.g., 80 participants took 1 psychotropic medication, etc.):

total psychotropic medications 1 2 3 4 5 6 7 8
participant count 79 66 43 27 10 6 2 1

PLEASE VERIFY: Data summary – all values appear reasonable?

The table below shows descriptive statistics for average \(mg\) per day. Note: PRN medications are not included here (n=33).

mg (daily dose)
medication name participant count mean minimum maximum standard deviation
Atypical Antipsychotic
aripiprazole 45 14.748 5.000 40.000 8.132
clozapine 61 338.934 50.000 800.000 182.376
lurasidone 10 54.000 20.000 100.000 25.033
olanzapine 36 15.000 2.500 30.000 7.440
paliperidone 20 4.704 2.679 7.143 1.362
quetiapine 24 263.472 8.333 1000.000 221.042
risperidone 43 3.568 0.286 8.000 1.864
ziprasidone 6 70.000 20.000 200.000 66.633
Typical Antipsychotic
fluphenazine 10 11.443 1.786 40.000 13.028
haloperidol 14 4.122 2.000 10.000 1.865
loxapine 3 80.000 30.000 150.000 62.450
perphenazine 5 14.000 2.000 20.000 6.928
thiothixene 2 10.000 10.000 10.000 0.000
Other Psychoactive
alprazolam 1 6.000 6.000 6.000 NA
atomoxetine 1 60.000 60.000 60.000 NA
bromazepam 1 1.500 1.500 1.500 NA
bupropion 12 210.417 75.000 450.000 132.055
buspirone 4 106.250 60.000 200.000 66.002
citalopram 12 27.500 10.000 40.000 12.881
clomipramine 4 156.250 25.000 250.000 102.825
clonazepam 28 0.875 0.500 2.000 0.520
dextroamphetamine 2 20.000 20.000 20.000 0.000
diazepam 1 5.000 5.000 5.000 NA
doxepin 1 10.000 10.000 10.000 NA
duloxetine 3 60.000 60.000 60.000 0.000
escitalopram 19 13.947 5.000 40.000 8.093
eszopiclone 1 3.000 3.000 3.000 NA
fluoxetine 8 42.500 10.000 80.000 21.876
guanfacine 1 4.000 4.000 4.000 NA
lamotrigine 10 190.000 100.000 300.000 56.765
lisdexamfetamine 1 59.000 59.000 59.000 NA
lithium 13 742.308 150.000 1200.000 305.400
lorazepam 29 1.916 0.050 8.000 1.771
methoprazine 1 25.000 25.000 25.000 NA
methylphenidate 2 45.000 36.000 54.000 12.728
paroxetine 3 25.000 10.000 40.000 15.000
periciazine 1 10.000 10.000 10.000 NA
sertraline 24 133.333 25.000 300.000 72.106
trazodone 10 85.000 50.000 200.000 44.410
valproate 16 835.938 125.000 1500.000 410.078
venlafaxine 9 158.333 75.000 300.000 69.597
vortioxetine 1 20.000 20.000 20.000 NA
zopiclone 2 5.268 0.536 10.000 6.692
benztropine 27 1.574 0.500 5.000 1.044
Other Neuroactive
gabapentin 3 900.000 900.000 900.000 0.000
naltrexone 1 100.000 100.000 100.000 NA
oxcarbazepine 1 1200.000 1200.000 1200.000 NA

Visualizations: Below are interactive heat maps, tabbed by drug classification category, which indicate the daily-dose in \(mg\) (greyscale) by participant (\(x\) axis) and medication (\(y\) axis). Note: PRN medications are not included here (n=33).

Atypical Antipsychotic

Typical Antipsychotic

Other Psychoactive

Other Neuroactive


PLEASE VERIFY: Coding of depression medication

#identify depression drugs
depression <- c(
  "alprazolam", 
  "bupropion",        
  "citalopram",        
  "clomipramine",  
  "doxepin",      
  "duloxetine",        
  "escitalopram",   
  "fluoxetine",       
  "lithium",      
  "paroxetine",
  "oxcarbazepine", #off-label
  "sertraline",       
  "trazodone",     
  "venlafaxine",      
  "vortioxetine")

#identify non-depression drugs
not_depression <- c(
  "atomoxetine", #ADHD   
  "benztropine", #Parkinson's    
  "bromazepam", #anxiety    
  "buspirone", #anxiety       
  "clonazepam", #panic, seizures    
  "dextroamphetamine", #ADHD
  "diazepam", #anxiety     
  "eszopiclone", #insomnia   
  "gabapentin", #seizures     
  "guanfacine", #ADHD      
  "lamotrigine", #seizures        
  "lisdexamfetamine", #ADHD  
  "lorazepam", #anxiety    
  "methoprazine", #anxiety    
  "methylphenidate",  #ADHD
  "naltrexone", #drug abuse
  "periciazine",  #anxiety    
  "valproate",  #epilepsy       
  "zopiclone" #insomnia
)

Summary of depression medications.

mg (daily dose)
medication name participant count mean minimum maximum standard deviation
alprazolam 1 6.000 6 6 NA
bupropion 12 210.417 75 450 132.055
citalopram 12 27.500 10 40 12.881
clomipramine 4 156.250 25 250 102.825
doxepin 1 10.000 10 10 NA
duloxetine 3 60.000 60 60 0.000
escitalopram 19 13.947 5 40 8.093
fluoxetine 8 42.500 10 80 21.876
lithium 13 742.308 150 1200 305.400
oxcarbazepine 1 1200.000 1200 1200 NA
paroxetine 3 25.000 10 40 15.000
sertraline 24 133.333 25 300 72.106
trazodone 10 85.000 50 200 44.410
venlafaxine 9 158.333 75 300 69.597
vortioxetine 1 20.000 20 20 NA

In total, n=105 participants took n=121 depression medications (15 unique).