-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Analysis on the reason-phase asssociations
- Loading branch information
Showing
2 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
library(ggplot2) | ||
library(dplyr) | ||
library(forcats) | ||
library(cowplot) | ||
library(stringr) | ||
|
||
# Load data | ||
data <- read.csv("./data/reason_vs_phase_predictions.csv") | ||
|
||
plot <- data %>% | ||
filter(!(comparison %in% (c("Success", "Insufficient_Data", "No_Context", "Interim_Analysis", "Another_Study")))) %>% | ||
filter(prediction != "Other") %>% | ||
mutate(is_significant = pvalue < 0.05) %>% | ||
mutate(comparison = str_replace_all(comparison, "_", " ")) %>% | ||
mutate(comparison = fct_rev(fct_reorder(comparison, comparisonTotal))) %>% | ||
mutate(prediction = fct_rev(fct_relevel(prediction, c("Early Phase 1", "Phase 1", "Phase 1/Phase 2", "Phase 2", "Phase 2/Phase 3", "Phase 3", "Phase 4")))) %>% | ||
ggplot(aes(x = or_result, y = prediction, color = is_significant)) + | ||
geom_vline(aes(xintercept = 1), | ||
linewidth = .25, | ||
linetype = "dashed" | ||
) + | ||
geom_errorbar( | ||
aes(xmin = lower_ci, xmax = upper_ci), | ||
width = 0, | ||
# color = "steelblue", | ||
linewidth = 1 | ||
) + | ||
geom_point( | ||
# color = "steelblue", | ||
size = 3 | ||
) + | ||
scale_color_manual( | ||
name = "P-value", | ||
values = c("darkgrey", "steelblue"), | ||
labels = c(">0.05", "<0.05") | ||
) + | ||
scale_x_log10(name = "Odds Ratio") + | ||
facet_wrap(. ~ comparison, ncol = 5) + | ||
theme_cowplot(font_size = 12) + | ||
panel_border(color = "black") + | ||
theme( | ||
axis.title.y = element_blank(), | ||
axis.line = element_blank(), | ||
panel.spacing = unit(-0.1, "lines"), | ||
legend.position = "bottom", | ||
strip.placement = "outside", | ||
strip.background = element_blank(), | ||
) | ||
ggsave("./temp/figures/test_figure_phase_reason.png", plot, width = 9, height = 6, dpi = 300) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
prediction,comparison,comparisonType,predictionType,a,predictionTotal,comparisonTotal,total,b,c,d,or_result,lower_ci,upper_ci,pvalue | ||
Phase 2/Phase 3,Safety_Sideeffects,reason,clinical,20,598,977,31867,578,957,30312,1.0959855,0.69855195,1.7195345,0.6323376 | ||
Phase 2/Phase 3,Study_Staff_Moved,reason,clinical,24,598,1535,31867,574,1511,29758,0.82345265,0.54560417,1.2427951,0.43946645 | ||
Phase 2/Phase 3,Business_Administrative,reason,clinical,124,598,6826,31867,474,6702,24567,0.95893914,0.7854797,1.170704,0.7247067 | ||
Phase 2/Phase 3,Study_Design,reason,clinical,42,598,2070,31867,556,2028,29241,1.0891777,0.7933956,1.4952291,0.5582876 | ||
Phase 2/Phase 3,No_Context,reason,clinical,1,598,266,31867,597,265,31004,0.19597358,0.027457848,1.3987128,0.06846941 | ||
Phase 2/Phase 3,Another_Study,reason,clinical,22,598,932,31867,576,910,30359,1.2742255,0.8281937,1.9604719,0.2685104 | ||
Phase 2/Phase 3,Regulatory,reason,clinical,21,598,986,31867,577,965,30304,1.1429207,0.73600584,1.7748065,0.54969764 | ||
Phase 2/Phase 3,Insufficient_Enrollment,reason,clinical,175,598,10473,31867,423,10298,20971,0.8424884,0.7053029,1.0063573,0.0588874 | ||
Phase 2/Phase 3,Invalid_Reason,reason,clinical,31,598,1862,31867,567,1831,29438,0.8790197,0.6104663,1.2657137,0.5382996 | ||
Phase 2/Phase 3,Negative,reason,clinical,69,598,2197,31867,529,2128,29141,1.7861842,1.3845589,2.3043108,2.8041064e-05 | ||
Phase 2/Phase 3,Interim_Analysis,reason,clinical,3,598,85,31867,595,82,31187,1.9176266,0.6041921,6.0862956,0.214216 | ||
Phase 2/Phase 3,Covid19,reason,clinical,25,598,1421,31867,573,1396,29873,0.93363863,0.62331766,1.3984541,0.84132785 | ||
Phase 2/Phase 3,Logistics_Resources,reason,clinical,40,598,2204,31867,558,2164,29105,0.9641312,0.6974675,1.3327488,0.9350782 | ||
Phase 2/Phase 3,Insufficient_Data,reason,clinical,1,598,29,31867,597,28,31241,1.868928,0.25386962,13.758604,0.42282745 | ||
Phase 2,Safety_Sideeffects,reason,clinical,296,6505,977,31867,6209,681,24681,1.727769,1.5031632,1.9859359,1.151043e-13 | ||
Phase 2,Business_Administrative,reason,clinical,1378,6505,6826,31867,5127,5448,19914,0.98244286,0.91914743,1.050097,0.6113729 | ||
Phase 2,No_Context,reason,clinical,57,6505,266,31867,6448,209,25153,1.0638816,0.79276913,1.4277097,0.7024256 | ||
Phase 2,Regulatory,reason,clinical,146,6505,986,31867,6359,840,24522,0.6702559,0.56102663,0.80075157,5.4744874e-06 | ||
Phase 2,Another_Study,reason,clinical,219,6505,932,31867,6286,713,24649,1.2044243,1.0325876,1.4048569,0.018741148 | ||
Phase 2,Insufficient_Enrollment,reason,clinical,2341,6505,10473,31867,4164,8132,17230,1.1911833,1.1250877,1.2611618,2.2541422e-09 | ||
Phase 2,Study_Design,reason,clinical,329,6505,2070,31867,6176,1741,23621,0.72275,0.6403116,0.81580216,6.905896e-08 | ||
Phase 2,Logistics_Resources,reason,clinical,349,6505,2204,31867,6156,1855,23507,0.71842283,0.63861835,0.80819994,1.5973923e-08 | ||
Phase 2,Negative,reason,clinical,697,6505,2197,31867,5808,1500,23862,1.9090695,1.7372507,2.0978818,2.4835588e-38 | ||
Phase 2,Invalid_Reason,reason,clinical,340,6505,1862,31867,6165,1522,23840,0.8638482,0.7655077,0.974822,0.017747581 | ||
Phase 2,Study_Staff_Moved,reason,clinical,203,6505,1535,31867,6302,1332,24030,0.5811218,0.5000482,0.67534006,6.7508804e-14 | ||
Phase 2,Insufficient_Data,reason,clinical,2,6505,29,31867,6503,27,25335,0.28858477,0.068608314,1.213864,0.102292076 | ||
Phase 2,Interim_Analysis,reason,clinical,21,6505,85,31867,6484,64,25298,1.2802138,0.7814326,2.0973623,0.34486288 | ||
Phase 2,Covid19,reason,clinical,125,6505,1421,31867,6380,1296,24066,0.36382142,0.3021839,0.43803132,7.592309e-34 | ||
Phase 2,Success,reason,clinical,2,6505,4,31867,6503,2,25360,3.8997386,0.5492268,27.689764,0.18716608 | ||
Phase 3,Logistics_Resources,reason,clinical,128,3144,2204,31867,3016,2076,26647,0.54475296,0.45391288,0.6537726,2.092624e-12 | ||
Phase 3,Safety_Sideeffects,reason,clinical,122,3144,977,31867,3022,855,27868,1.315846,1.0844973,1.5965466,0.006408444 | ||
Phase 3,Invalid_Reason,reason,clinical,153,3144,1862,31867,2991,1709,27014,0.8085779,0.68240595,0.9580781,0.013012059 | ||
Phase 3,Regulatory,reason,clinical,120,3144,986,31867,3024,866,27857,1.2764856,1.0507916,1.5506551,0.016839085 | ||
Phase 3,Insufficient_Data,reason,clinical,1,3144,29,31867,3143,28,28695,0.32606474,0.044349425,2.397285,0.3572146 | ||
Phase 3,Business_Administrative,reason,clinical,727,3144,6826,31867,2417,6099,22624,1.1157541,1.0221773,1.2178977,0.015217895 | ||
Phase 3,Insufficient_Enrollment,reason,clinical,924,3144,10473,31867,2220,9549,19174,0.8357451,0.77105546,0.905862,1.0807367e-05 | ||
Phase 3,Another_Study,reason,clinical,114,3144,932,31867,3030,818,27905,1.2834854,1.0513588,1.5668627,0.016412841 | ||
Phase 3,No_Context,reason,clinical,94,3144,266,31867,3050,172,28551,5.115886,3.9677367,6.5962777,1.4936357e-29 | ||
Phase 3,Study_Staff_Moved,reason,clinical,47,3144,1535,31867,3097,1488,27235,0.2777673,0.2072746,0.37223405,1.3879165e-25 | ||
Phase 3,Negative,reason,clinical,452,3144,2197,31867,2692,1745,26978,2.5958388,2.3236551,2.8999047,0.0 | ||
Phase 3,Study_Design,reason,clinical,205,3144,2070,31867,2939,1865,26858,1.0044981,0.86530614,1.1660802,0.939256 | ||
Phase 3,Success,reason,clinical,1,3144,4,31867,3143,3,28720,3.045922,0.31674212,29.290836,0.3399976 | ||
Phase 3,Covid19,reason,clinical,50,3144,1421,31867,3094,1371,27352,0.32240468,0.2425431,0.42856207,3.1658945e-20 | ||
Phase 3,Interim_Analysis,reason,clinical,6,3144,85,31867,3138,79,28644,0.69327396,0.30206007,1.5911695,0.4691061 | ||
Other,Business_Administrative,reason,clinical,2670,13582,6826,31867,10912,4156,14129,0.8318457,0.7876026,0.8785742,3.7172435e-11 | ||
Other,Another_Study,reason,clinical,336,13582,932,31867,13246,596,17689,0.75285536,0.65739167,0.86218184,3.4969686e-05 | ||
Other,Success,reason,clinical,1,13582,4,31867,13581,3,18282,0.44871512,0.04667029,4.314206,0.64113593 | ||
Other,Study_Staff_Moved,reason,clinical,906,13582,1535,31867,12676,629,17656,2.006262,1.8076435,2.226704,7.6992e-40 | ||
Other,Covid19,reason,clinical,1004,13582,1421,31867,12578,417,17868,3.4202828,3.0443318,3.8426607,0.0 | ||
Other,Insufficient_Enrollment,reason,clinical,4467,13582,10473,31867,9115,6006,12279,1.001929,0.9556758,1.0504209,0.94232625 | ||
Other,Logistics_Resources,reason,clinical,1174,13582,2204,31867,12408,1030,17255,1.5850539,1.453276,1.728781,2.6146928e-25 | ||
Other,Regulatory,reason,clinical,441,13582,986,31867,13141,545,17740,1.0923637,0.96155554,1.2409669,0.17990828 | ||
Other,Safety_Sideeffects,reason,clinical,186,13582,977,31867,13396,791,17494,0.30707923,0.26133722,0.36082748,0.0 | ||
Other,Invalid_Reason,reason,clinical,903,13582,1862,31867,12679,959,17326,1.2867153,1.1715962,1.4131458,1.5587668e-07 | ||
Other,Study_Design,reason,clinical,929,13582,2070,31867,12653,1141,17144,1.1031859,1.0086321,1.2066038,0.032566372 | ||
Other,Interim_Analysis,reason,clinical,40,13582,85,31867,13542,45,18240,1.1972629,0.7815663,1.8340584,0.44253474 | ||
Other,No_Context,reason,clinical,31,13582,266,31867,13551,235,18050,0.1757113,0.120742604,0.25570476,2.9066267e-28 | ||
Other,Insufficient_Data,reason,clinical,17,13582,29,31867,13565,12,18273,1.9083487,0.9111258,3.9970274,0.091994174 | ||
Other,Negative,reason,clinical,477,13582,2197,31867,13105,1720,16565,0.35054547,0.3159268,0.38895756,0.0 | ||
Phase 1/Phase 2,Logistics_Resources,reason,clinical,100,1599,2204,31867,1499,2104,28164,0.89299077,0.72586054,1.098603,0.31164655 | ||
Phase 1/Phase 2,No_Context,reason,clinical,3,1599,266,31867,1596,263,30005,0.2144501,0.068644606,0.66995573,0.0010545078 | ||
Phase 1/Phase 2,Business_Administrative,reason,clinical,411,1599,6826,31867,1188,6415,23853,1.2863872,1.1460699,1.4438841,2.7292892e-05 | ||
Phase 1/Phase 2,Study_Design,reason,clinical,124,1599,2070,31867,1475,1946,28322,1.2235191,1.0128862,1.4779538,0.042081945 | ||
Phase 1/Phase 2,Another_Study,reason,clinical,59,1599,932,31867,1540,873,29395,1.2900023,0.9861613,1.6874584,0.06726852 | ||
Phase 1/Phase 2,Negative,reason,clinical,132,1599,2197,31867,1467,2065,28203,1.2289071,1.0227585,1.4766074,0.0294262 | ||
Phase 1/Phase 2,Invalid_Reason,reason,clinical,89,1599,1862,31867,1510,1773,28495,0.94726825,0.76087964,1.1793154,0.6618692 | ||
Phase 1/Phase 2,Insufficient_Enrollment,reason,clinical,452,1599,10473,31867,1147,10021,20247,0.7962045,0.712234,0.89007497,5.226312e-05 | ||
Phase 1/Phase 2,Regulatory,reason,clinical,46,1599,986,31867,1553,940,29328,0.92414683,0.6843954,1.2478858,0.6568592 | ||
Phase 1/Phase 2,Safety_Sideeffects,reason,clinical,82,1599,977,31867,1517,895,29373,1.7739997,1.4067521,2.237121,6.677744e-06 | ||
Phase 1/Phase 2,Study_Staff_Moved,reason,clinical,62,1599,1535,31867,1537,1473,28795,0.7885553,0.6084858,1.0219128,0.07224854 | ||
Phase 1/Phase 2,Covid19,reason,clinical,35,1599,1421,31867,1564,1386,28882,0.4663321,0.33215758,0.6547063,1.0773974e-06 | ||
Phase 1/Phase 2,Interim_Analysis,reason,clinical,4,1599,85,31867,1595,81,30187,0.93461823,0.3420608,2.5536723,1.0 | ||
Phase 4,Regulatory,reason,clinical,98,2972,986,31867,2874,888,28007,1.0754567,0.8698951,1.3295938,0.5042549 | ||
Phase 4,Study_Design,reason,clinical,194,2972,2070,31867,2778,1876,27019,1.0057868,0.8631943,1.1719344,0.9376931 | ||
Phase 4,Insufficient_Data,reason,clinical,6,2972,29,31867,2966,23,28872,2.5393884,1.0331895,6.2413464,0.04800868 | ||
Phase 4,Business_Administrative,reason,clinical,559,2972,6826,31867,2413,6267,22628,0.8364519,0.7597649,0.92087924,0.0002482151 | ||
Phase 4,Logistics_Resources,reason,clinical,217,2972,2204,31867,2755,1987,26908,1.0666493,0.92220557,1.2337172,0.3826065 | ||
Phase 4,No_Context,reason,clinical,35,2972,266,31867,2937,231,28664,1.4787301,1.0342264,2.1142783,0.04320678 | ||
Phase 4,Insufficient_Enrollment,reason,clinical,1224,2972,10473,31867,1748,9249,19646,1.4873711,1.3769815,1.6066105,2.0498144e-23 | ||
Phase 4,Negative,reason,clinical,149,2972,2197,31867,2823,2048,26847,0.6918966,0.58328164,0.8207372,1.1865914e-05 | ||
Phase 4,Invalid_Reason,reason,clinical,128,2972,1862,31867,2844,1734,27161,0.7049804,0.5867171,0.8470817,0.00011109484 | ||
Phase 4,Safety_Sideeffects,reason,clinical,71,2972,977,31867,2901,906,27989,0.75608355,0.59205425,0.96555746,0.025218073 | ||
Phase 4,Another_Study,reason,clinical,59,2972,932,31867,2913,873,28022,0.6501243,0.4980846,0.848574,0.0010858 | ||
Phase 4,Study_Staff_Moved,reason,clinical,141,2972,1535,31867,2831,1394,27501,0.9825733,0.8227907,1.173385,0.8926409 | ||
Phase 4,Interim_Analysis,reason,clinical,6,2972,85,31867,2966,79,28816,0.73788166,0.32148212,1.6936225,0.57772374 | ||
Phase 4,Covid19,reason,clinical,85,2972,1421,31867,2887,1336,27559,0.60733616,0.48614597,0.75873756,3.5730477e-06 | ||
Phase 1,No_Context,reason,clinical,45,3050,266,31867,3005,221,28596,1.9376755,1.4031923,2.6757462,0.0002090102 | ||
Phase 1,Logistics_Resources,reason,clinical,173,3050,2204,31867,2877,2031,26786,0.7930566,0.67585105,0.9305879,0.0038471587 | ||
Phase 1,Safety_Sideeffects,reason,clinical,193,3050,977,31867,2857,784,28033,2.4154642,2.0539482,2.8406107,9.634693e-23 | ||
Phase 1,Another_Study,reason,clinical,116,3050,932,31867,2934,816,28001,1.356692,1.1128033,1.6540328,0.003264855 | ||
Phase 1,Study_Design,reason,clinical,227,3050,2070,31867,2823,1843,26974,1.1768876,1.0198538,1.358101,0.02761821 | ||
Phase 1,Study_Staff_Moved,reason,clinical,108,3050,1535,31867,2942,1427,27390,0.7046106,0.5773098,0.859982,0.00036858692 | ||
Phase 1,Insufficient_Enrollment,reason,clinical,757,3050,10473,31867,2293,9716,19101,0.6490235,0.59571236,0.7071055,3.0139429e-24 | ||
Phase 1,Negative,reason,clinical,208,3050,2197,31867,2842,1989,26828,0.9871719,0.8513943,1.1446028,0.91022694 | ||
Phase 1,Invalid_Reason,reason,clinical,191,3050,1862,31867,2859,1671,27146,1.085297,0.929851,1.2667294,0.29148293 | ||
Phase 1,Regulatory,reason,clinical,96,3050,986,31867,2954,890,27927,1.0197531,0.82334715,1.2630109,0.8260978 | ||
Phase 1,Business_Administrative,reason,clinical,858,3050,6826,31867,2192,5968,22849,1.4985979,1.3779767,1.6297778,3.0819916e-20 | ||
Phase 1,Interim_Analysis,reason,clinical,5,3050,85,31867,3045,80,28737,0.5898399,0.23878907,1.456981,0.35286313 | ||
Phase 1,Covid19,reason,clinical,73,3050,1421,31867,2977,1348,27469,0.49968576,0.39363992,0.6343002,5.0854754e-10 | ||
Early Phase 1,Invalid_Reason,reason,clinical,27,417,1862,31867,390,1835,29615,1.1173129,0.75431406,1.654998,0.52944094 | ||
Early Phase 1,Business_Administrative,reason,clinical,99,417,6826,31867,318,6727,24723,1.1441628,0.9116463,1.4359828,0.253541 | ||
Early Phase 1,Regulatory,reason,clinical,18,417,986,31867,399,968,30482,1.4205866,0.88203937,2.2879548,0.1524232 | ||
Early Phase 1,Study_Staff_Moved,reason,clinical,44,417,1535,31867,373,1491,29959,2.3702464,1.7268128,3.253432,1.3221835e-06 | ||
Early Phase 1,Negative,reason,clinical,13,417,2197,31867,404,2184,29266,0.431194,0.24778876,0.75034994,0.0012141551 | ||
Early Phase 1,Another_Study,reason,clinical,7,417,932,31867,410,925,30525,0.56341463,0.266151,1.1926916,0.14342073 | ||
Early Phase 1,Study_Design,reason,clinical,20,417,2070,31867,397,2050,29400,0.72249186,0.46004087,1.1346699,0.19220513 | ||
Early Phase 1,Logistics_Resources,reason,clinical,23,417,2204,31867,394,2181,29269,0.7834005,0.5133507,1.1955107,0.2856112 | ||
Early Phase 1,Insufficient_Enrollment,reason,clinical,133,417,10473,31867,284,10340,21110,0.95609486,0.7771102,1.1763034,0.71343344 | ||
Early Phase 1,Covid19,reason,clinical,24,417,1421,31867,393,1397,30053,1.313742,0.8670072,1.9906621,0.18886684 | ||
Early Phase 1,Safety_Sideeffects,reason,clinical,7,417,977,31867,410,970,30480,0.5364848,0.25346217,1.1355381,0.11396187 | ||
Early Phase 1,Insufficient_Data,reason,clinical,2,417,29,31867,415,27,31423,5.608746,1.3294287,23.66282,0.05499008 |