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)
Viagra, which treats erectile dysfunction (acute), had the highest median of average price of $35.47.
Xanax, which treats anxiety and panic attack (acute), had the lowest median of average price of $3.41.
There is no clear trend between disease type (acute vs. chronic) and disease condition (i.e: psychiatric drugs vs. cardiovascular).
final_dataset %>%
filter(!is.na(avg_price)) %>%
filter(trade_name %in% most_popular_drugs) %>%
plot_ly(y = ~avg_price, type = "box", color = ~trade_name, colors = "Set3") %>%
layout(title = "Distribution of Average Price for Popular Drugs", xaxis = trade_name_axis, yaxis = avg_price_axis)