Unit 3: Evalution of Metal Illness Treatments

Daniel Lee 3/8/2021

Source of data https://www.datafiles.samhsa.gov/study-series/national-mental-health-services-survey-n-mhss-nid13521

The data came from SAMHDA, National Mental Health Services Survey, 2019 and 2010. Selected are the variables that start with TREAT (indicating the type of treatment).

A good brief reading on the history of mental illness treatments https://dualdiagnosis.org/mental-health-and-addiction/history/

Import data

# load package
library(readr) #for read_csv() function
library(tidyverse)
DIR <- "C:/Users/sclee1/OneDrive/Documents/R/Madness/data/"
# import data
load(paste0(DIR,"nmhss_2019_puf_R.RData"))
load(paste0(DIR, "N-MHSS-2010-DS0001-data-r.rda"))

rename data

treat2019 <- PUF
treat2010 <- da34945.0001

Clean data

Create function to clean data

clean <- function(x){
  #select variables that start with TREAT
  select(x, starts_with("TREAT")) %>%
  mutate(n_total = n()) %>%
  pivot_longer(-n_total, names_to = "Treatment", values_to = "count") %>%
  mutate(count = as.numeric(stringr::str_extract(count, "\\d"))) %>% #for2010 that has (0)No, (1)Yes
  group_by(Treatment) %>%
  summarise(n = sum(count, na.rm = TRUE),
            n_total = mean(n_total)) %>%
  ungroup() %>% 
  transmute(Treatment, percent = n / n_total) %>%
  mutate(Treatment = case_when(
    Treatment == "TREATPSYCHOTHRPY" ~ "psychotherapy",
    Treatment == "TREATFAMTHRPY" ~ "family therapy",
    Treatment == "TREATGRPTHRPY" ~ "group therapy",
    Treatment == "TREATCOGTHRPY" ~ "cognitive behavioral therapy",
    Treatment == "TREATDIALTHRPY" ~ "dialectical behavior therapy",
    Treatment == "TREATBEHAVMOD" ~ "behavior modification",
    Treatment == "TREATDUALMHSA" ~ "integrated dual disorders treatment",
    Treatment == "TREATTRAUMATHRPY" ~ "trauma therapy",
    Treatment == "TREATACTVTYTHRPY" ~ "activity therapy",
    Treatment == "TREATELECTRO" ~ "electroconvulsive therapy",
    Treatment == "TREATTELEMEDINCE" ~ "telemedicine therapy",
    Treatment == "TREATPSYCHOMED" ~ "psychotropic medication",
    Treatment == "TREATOTH" ~ "mentalhealth treatment approach",
    Treatment == "TREATMT" ~ "substanceuse treatment",
    TRUE ~ as.character(Treatment)))
}

Clean data

treat10_cleaned <- clean(treat2010)
treat19_cleaned <- clean(treat2019)

Rename percent column

treat10_cleaned <- treat10_cleaned %>% rename(percent10 = percent)
treat19_cleaned <- treat19_cleaned %>% rename(percent19 = percent)

Join data

treat_joined <- treat19_cleaned %>%
  left_join(treat10_cleaned) %>%
  mutate(percent10 = ifelse(is.na(percent10), 0, percent10),
         Treatment = fct_reorder(Treatment, percent19)) %>%
  pivot_longer(names_to = "Year", values_to = "Percent", - Treatment) %>%
  mutate(Year = stringr::str_remove(Year, "percent"),
        Year = paste0("20",Year))
## Joining, by = "Treatment"
treat_joined
## # A tibble: 28 x 3
##    Treatment                           Year  Percent
##    <fct>                               <chr>   <dbl>
##  1 activity therapy                    2019    0.446
##  2 activity therapy                    2010    0.451
##  3 behavior modification               2019    0.660
##  4 behavior modification               2010    0.574
##  5 cognitive behavioral therapy        2019    0.902
##  6 cognitive behavioral therapy        2010    0.777
##  7 dialectical behavior therapy        2019    0.563
##  8 dialectical behavior therapy        2010    0    
##  9 integrated dual disorders treatment 2019    0.566
## 10 integrated dual disorders treatment 2010    0.479
## # ... with 18 more rows

Visualize data

treat_joined %>%
  ggplot(aes(Percent, Treatment, fill = Year)) +
  geom_col(position = "dodge", alpha = 0.8) +
  scale_x_continuous(labels = scales::percent_format()) +
  labs(title = "Common Mental Illness Treatments in the U.S.",
       y = NULL,
       x = "% of Facilities with Treatment",
       caption = "Data Source: SAMHDA, National Mental Health Services Survey")

Definition of variables

Codebook

  1. TREATPSYCHOTHRPY: Facility offers individual psychotherapy (Q.A10)
  2. TREATFAMTHRPY: Facility offers couples/family therapy (Q.A10)
  3. TREATGRPTHRPY: Facility offers group therapy (Q.A10)
  4. TREATCOGTHRPY: Facility offers cognitive behavioral therapy (Q.A10)
  5. TREATDIALTHRPY: Facility offers dialectical behavior therapy (Q.A10)
  6. TREATBEHAVMOD: Facility offers behavior modification (Q.A10)
  7. TREATDUALMHSA: Facility offers integrated dual disorders treatment (Q.A10)
  8. TREATTRAUMATHRPY: Facility offers trauma therapy (Q.A10)
  9. TREATACTVTYTHRPY: Facility offers activity therapy (Q.A10)
  10. TREATELECTRO: Facility offers electroconvulsive therapy (Q.A10)
  11. TREATTELEMEDINCE: Facility offers telemedicine/telehealth therapy (Q.A10)
  12. TREATPSYCHOMED: Facility offers psychotropic medication (Q.A10)
  13. TREATOTH: Facility offers other mental health treatment approach (Q.A10)
  14. TREATMT: Facility offers substance use treatment (Q.A1)