The Distribution of Average Price for Most Abused Drugs
  • Ambien and Lunesta, which both treat sleep disorders, have the highest median of average drug price of $13.45 and $11.94 respectively. Focalin and Ritalin, which both treat ADHD, have the lowest median of average drug price of $0.97 each.
final_dataset %>%
  filter(!is.na(avg_price)) %>%
  filter(trade_name %in% most_abused_drugs) %>%
  group_by(trade_name) %>% 
  plot_ly(y = ~avg_price, type = "box", color = ~trade_name, colors = "Set3") %>%
  layout(title = "Distribution of Average Price for Most Abused Drugs", xaxis = trade_name_axis, yaxis = avg_price_axis)