#Avg Drug Prices by Company for each Disease
pharma_charge = patents %>%
group_by(disease, appfull) %>%
summarize(comp_avg_price = mean(avg_price))
pharma_charge %>%
plot_ly(x = ~comp_avg_price, y = ~disease, type = "scatter", text = ~paste('Company: ', appfull, '<br> Disease', disease), color = "red") %>%
layout(title = "Avg Drug Price By Disease",
yaxis = list(
title = "",
zeroline = FALSE,
showline = FALSE,
showticklabels = TRUE,
showgrid = TRUE))
#No. of Patents Currently Held by Pharma Company
patents %>%
group_by(appfull) %>%
count() %>%
rename(num_pat_held = n) %>%
ungroup() %>%
mutate(appfull = fct_reorder(appfull, num_pat_held)) %>%
plot_ly(x = ~appfull, y = ~num_pat_held, color = ~appfull, type = "bar", colors = "blue") %>%
layout(title = "No. of Patents Currently Held by Pharmaceutical Company", yaxis = yax, showlegend = FALSE)
#xaxis = xax_pharma,
AstraZeneca is currently the largest patent holder. Keryx Pharmaceuticals has the most number of patents expiring overall. Keryx’s 11 patents expiring in 2024 cover chronic kidney disease allowing generics to enter the kidney disease markt.
#Projection of Expiring Patents by Pharma Company
pat_exp = patents %>%
group_by(appfull, year_pat_expires) %>%
count() %>%
rename(num_pat_exp = n)
#No. of Patents Currently Held by Disease
patents %>%
group_by(disease) %>%
count() %>%
rename(num_pat_held = n) %>%
ungroup() %>%
mutate(disease = fct_reorder(disease, num_pat_held)) %>%
plot_ly(x = ~disease, y = ~num_pat_held, color = ~disease, type = "bar", colors = "red") %>%
layout(title = "No. of Patents Currently Held by Disease", yaxis = yax, showlegend = FALSE)
#xaxis = xax_disease,
#Projection of Expiring Patents by Disease
patents %>%
group_by(disease, year_pat_expires) %>%
count() %>%
rename(num_pat_exp = n) %>%
# ungroup() %>%
plot_ly(x = ~year_pat_expires,
y = ~disease,
color = ~disease,
type = "scatter",
colors = "Set3",
mode = 'markers',
marker = list(size = ~num_pat_exp*3),
text = ~paste('Disease:', disease, 'Count:', num_pat_exp)) %>%
layout(title = "Projection of Expiring Patents by Disease",
yaxis = list(
title = "",
zeroline = FALSE,
showline = FALSE,
showticklabels = TRUE,
showgrid = TRUE),
showlegend = FALSE)
The disease with the most patents expiring over the next several years chronic kidney disease.