In [1]:
library(data.table)
In [2]:
sms <- list.files("/media/igna/Elements/HotelDieu/Cochrane/MappingRCTs_vs_Burden/Replicates/Metrics_over_repl/")
In [3]:
dis <- as.numeric(substr(sms,25,nchar(sms)-4))
dis
- 0
- 1
- 10
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 2
- 20
- 22
- 23
- 24
- 25
- 26
- 3
- 4
- 5
- 6
- 7
- 8
- 9
In [4]:
Mgbd <- read.table("../Data/27_gbd_groups.txt")
In [5]:
data_f <- data.frame()
for(k in dis[dis!=0]){
DF <- fread(paste(c("/media/igna/Elements/HotelDieu/Cochrane/MappingRCTs_vs_Burden/Replicates/Metrics_over_repl/Metrics_over_replicates_",
as.character(k),".txt"),collapse=""))
data <- DF[Dis=="dis",][,lapply(.SD,function(x){quantile(x,probs=c(0.025,0.5,0.975))}),
by=c("Region"),
.SDcols=c("RCTs","Patients")]
dataprop <- DF[,lapply(.SD[Dis=="dis",]/.SD[Dis=="all",],function(x){100*quantile(x,probs=c(0.025,0.5,0.975))}),
by=c("Region"),
.SDcols=c("RCTs","Patients")]
df <- data.frame(cbind(cbind(unique(data$Region),as.character(Mgbd$x[k])),
matrix(data$RCTs,ncol=3,byrow=TRUE),
matrix(data$Patients,ncol=3,byrow=TRUE),
matrix(dataprop$RCTs,ncol=3,byrow=TRUE),
matrix(dataprop$Patients,ncol=3,byrow=TRUE)))
names(df) <- c("Region","Disease",
paste(paste("Nb","RCTs",sep="_"),c("low","med","up"),sep="_"),
paste(paste("Nb","Patients",sep="_"),c("low","med","up"),sep="_"),
paste(paste("Prop","RCTs",sep="_"),c("low","med","up"),sep="_"),
paste(paste("Prop","Patients",sep="_"),c("low","med","up"),sep="_"))
data_f <- rbind(data_f,df)
}
In [6]:
table(data_f$Disease=="Congenital anomalies")
FALSE TRUE
207 9
In [7]:
#all diseases
DF <- fread(paste(c("/media/igna/Elements/HotelDieu/Cochrane/MappingRCTs_vs_Burden/Replicates/Metrics_over_repl/Metrics_over_replicates_",
as.character(0),".txt"),collapse=""))
data <- DF[,lapply(.SD,function(x){quantile(x,probs=c(0.025,0.5,0.975))}),
by=c("Region"),
.SDcols=c("RCTs","Patients")]
df <- data.frame(cbind(cbind(unique(data$Region),"All"),
matrix(data$RCTs,ncol=3,byrow=TRUE),
matrix(data$Patients,ncol=3,byrow=TRUE),
matrix(NA,nrow=length(unique(data$Region)),ncol=6)))
names(df) <- c("Region","Disease",
paste(paste("Nb","RCTs",sep="_"),c("low","med","up"),sep="_"),
paste(paste("Nb","Patients",sep="_"),c("low","med","up"),sep="_"),
paste(paste("Prop","RCTs",sep="_"),c("low","med","up"),sep="_"),
paste(paste("Prop","Patients",sep="_"),c("low","med","up"),sep="_"))
data_f <- rbind(data_f,df)
In [8]:
write.table(data_f,"../Data/RCTs_and_Patients_Nb_local_prop_median_UI_per_region_and_disease.txt")
In [9]:
data_f
Region Disease Nb_RCTs_low Nb_RCTs_med Nb_RCTs_up Nb_Patients_low Nb_Patients_med Nb_Patients_up Prop_RCTs_low Prop_RCTs_med Prop_RCTs_up Prop_Patients_low Prop_Patients_med Prop_Patients_up
1 Central Europe, Eastern Europe, and Central Asia Tuberculosis 4 17 28 817.791035280509 3727.45887445887 8286.37821455813 0.0670184629223417 0.279881461969048 0.465039030061452 0.0541345253732852 0.246996228187276 0.548102268596756
2 High-income Tuberculosis 28 95 186 4760.52142857143 20935.8779220779 80181.1191734 0.0445697341004633 0.152 0.298837432345686 0.0246145116753808 0.106212756460855 0.408072232458222
3 Latin America and Caribbean Tuberculosis 8 29 42 2031.4689484127 41578.255952381 46855.1901044703 0.185393444249661 0.67421141343607 0.985567832207902 0.25044366594425 4.89484230548107 5.74768206602598
4 North Africa and Middle East Tuberculosis 4 17 31 426.4375 2930.46428571429 4985.14201868919 0.050657984871941 0.214646464646465 0.393272107025709 0.0509666269158626 0.351318357907269 0.598363560953588
5 South Asia Tuberculosis 11 40 56 3184.94642857143 14501.0103479853 23036.5803571428 0.24519372262736 0.883197173769044 1.26012776852171 0.171534792285204 0.781339017910559 1.28564993265724
6 Southeast Asia, East Asia and Oceania Tuberculosis 15 53 76 5566.83035714286 28046.521031746 41850.471984127 0.169275419396122 0.603575902516798 0.872978293733491 0.17204138884611 0.869588012581335 1.32455313091434
7 Sub-Saharian Africa Tuberculosis 32 105 143 26077.3766666667 348533.348809524 490081.25436508 1.42492163779064 4.58756065284517 6.22541706134815 0.818396709662252 10.0117895103758 14.5069875713714
8 All Tuberculosis 91 298 454 66723.05 452171 649434 0.106771151141624 0.351994233541567 0.537748843907757 0.212385696168505 1.4356640298352 2.07318820327828
9 Non-HI Tuberculosis 66 217 304 57307.0123809524 428351.40620155 604073.611783425 0.233727409430704 0.76530612244898 1.0724506487047 0.501651122487786 3.63649616241897 5.17492400006109
10 Central Europe, Eastern Europe, and Central Asia Hepatitis 74 114 145 7715.30616512343 12548.4220964972 22183.6594418 1.2136600664145 1.86610907774073 2.38450926540375 0.514768325705959 0.839246898086557 1.48736113196973
11 High-income Hepatitis 412.975 628.5 910 98535.1793825832 169869.332450747 308290.018507962 0.669287887829622 1.01787605124043 1.47072393601537 0.507763166432222 0.870394717554044 1.57873226460582
12 Latin America and Caribbean Hepatitis 35 56 77 8390.10083446677 24088.154095927 31737.2008954347 0.828343142214968 1.31857781963739 1.81734503400777 1.00659027164541 2.87637169476625 3.83825981372682
13 North Africa and Middle East Hepatitis 43 68 106 3656.24030029857 6233.357932318 10681.58046102 0.53810510071966 0.859617235504793 1.33847098254008 0.445491467659216 0.756232922118722 1.29672302622227
14 South Asia Hepatitis 40 62 86 8188.72029577937 14953.1342308834 52628.6003086945 0.893644851678073 1.39424202512127 1.93060176416044 0.437533070621439 0.811377108759308 2.78726336881155
15 Southeast Asia, East Asia and Oceania Hepatitis 127 191 241 43573.8174995897 173801.210232777 202476.30722682 1.46456975143553 2.20751801389092 2.79582555793653 1.3549048302371 5.3679274837805 6.42497149040165
16 Sub-Saharian Africa Hepatitis 5 11 21 926.947023809524 3222.13496259488 75099.685 0.217957521088451 0.46908315565032 0.934164239461674 0.0263581494289545 0.0930646016741352 2.12936969258321
17 All Hepatitis 602 913 1300 211246.5 400936 598267.3 0.719832227521309 1.08896665725719 1.54853360044985 0.675362168778749 1.28344680200113 1.91797573095832
18 Non-HI Hepatitis 267 404 540 89168.4212870673 234307.105418378 340665.245467171 0.952525131846555 1.43529668109585 1.92490859834954 0.768151329891469 1.99778768377513 2.90740193579868
19 Central Europe, Eastern Europe, and Central Asia Neoplasms 1138 1232 1308 183827.211836229 226895.654396867 246204.497880263 17.3245030951206 18.5720730741276 19.5881092636764 11.4541672552595 13.8342928877313 14.9528258858498
20 High-income Neoplasms 8802.975 9501 10059.025 4062208.216989 4556668.09200813 4939833.09173478 13.121248118677 14.089178916948 14.875012663949 19.425583132019 21.4962170684835 23.1318144906128
21 Latin America and Caribbean Neoplasms 545.975 593 633 56239.636179842 64651.5727531692 75926.6519682964 11.8077701618096 12.766870530672 13.5845055739137 6.14207294372643 7.06517357795253 8.34176599259177
22 North Africa and Middle East Neoplasms 568 620 665 44745.8958794888 59436.7408077354 65244.0343887164 6.51818621249279 7.09600161501474 7.60721685780729 4.96915431770923 6.53677101875267 7.2543103038017
23 South Asia Neoplasms 543 591 631 67889.7034627344 97834.7917805781 152512.652660637 11.2437736018101 12.1719822365765 12.9688074488647 3.34451143555275 4.76792981671776 7.59309223277874
24 Southeast Asia, East Asia and Oceania Neoplasms 1854 2004 2125 441358.128719971 674856.763484969 725858.689941082 19.9678972712681 21.3612619345251 22.4966119914398 13.1891677872728 19.1707034808613 20.9669823598856
25 Sub-Saharian Africa Neoplasms 182 201 218 23579.8379819 35124.8077750845 141795.319949187 7.33495597552072 8.08341475391418 8.75502008032129 0.610566847142436 0.911547609343251 3.69961560110894
26 All Neoplasms 11147.975 12024 12728.025 5095632.85 5686771.5 6152196.2 12.2329808020536 13.129935720361 13.8685822990231 15.1341537920135 16.72065867709 17.9977481146424
27 Non-HI Neoplasms 3572.975 3858 4088.025 900394.037011502 1149422.10306029 1300220.14989145 11.6686193816845 12.5328962106091 13.2526171084795 7.08713168026867 8.93991392520057 10.1210658102694
28 Central Europe, Eastern Europe, and Central Asia Cardiovascular and circulatory diseases 681 767 858.025 280599.351921757 324455.267480318 367715.98116672 11.1421013103449 12.5363490106336 13.9805949773587 19.1576313877163 21.7597016118534 24.4373903566291
29 High-income Cardiovascular and circulatory diseases 7101 7959 8901.05 2724964.91643023 3114279.31836519 3554723.84155324 11.5998265883491 12.947106559978 14.4304363419511 14.1431238374785 16.0797392448512 18.2829788192143
30 Latin America and Caribbean Cardiovascular and circulatory diseases 446 509 575 94039.2028577901 112597.351070667 155117.007583547 10.5471587303295 11.9455120182578 13.4783970330764 11.3335047510722 13.5710261644395 18.489573534549
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮
196 Sub-Saharian Africa Neonatal disorders 21 46 102 24032.7296063976 169632.414205531 367055.401546708 0.926722719894912 2.04347826086956 4.45360454486091 0.699210948974975 4.81462581508111 10.3108609532856
197 All Neonatal disorders 638.95 1424 3612.79999999999 317800.45 779939 1655367.85 0.764590766452948 1.69948090685226 4.26012587577822 1.02160321469577 2.50025046101065 5.28274605941703
198 Non-HI Neonatal disorders 248 530 1247.05 145158.315350602 398018.290162006 789106.153197559 0.884084533491047 1.88828543682336 4.38891752702681 1.26216981915223 3.40537025497647 6.72949685485927
199 Central Europe, Eastern Europe, and Central Asia Nutritional deficiencies 38 75 132 7087.87668553057 17473.545323274 35666.8678843683 0.611569118252429 1.22521360631952 2.15469345998663 0.471012418571894 1.16523029003696 2.38146919584535
200 High-income Nutritional deficiencies 433 830 1444.025 88142.1077522116 192777.842895108 439904.988281275 0.700668184504674 1.34184660536221 2.33562403251808 0.450350614834347 0.983833605827001 2.23851178684879
201 Latin America and Caribbean Nutritional deficiencies 33 65 108 7918.37962402182 19801.544527086 36870.1254202695 0.766831767015252 1.52254808748352 2.54418899932266 0.962341005254684 2.38030131212012 4.40671283138598
202 North Africa and Middle East Nutritional deficiencies 59 116 200 7235.69709544978 17365.9551795188 28602.2953293863 0.746530986954376 1.46075002084669 2.51512636678602 0.881989235183836 2.10402128763192 3.47114622901864
203 South Asia Nutritional deficiencies 66 124 182 40387.7036821143 106015.480811218 186644.55117233 1.49979223490372 2.79881675060028 4.08342630204339 2.26280590863048 5.83839900588143 10.2753484178475
204 Southeast Asia, East Asia and Oceania Nutritional deficiencies 53 105 191 22325.1917162698 98468.5717954978 162530.774697926 0.610846732182581 1.21416760154535 2.19080294048595 0.710854465914014 3.04432525008589 5.07120884543755
205 Sub-Saharian Africa Nutritional deficiencies 50 93 131 56520.7328867478 115724.299266604 262523.188908829 2.21929508549929 4.13376274830183 5.76669457481341 1.62869187733395 3.3183308875102 7.52558134571771
206 All Nutritional deficiencies 677.975 1279 2138 281711.425 568439 983125.125 0.806362587337069 1.52370395983894 2.54448695551136 0.909011440071932 1.81704078040081 3.14076289365824
207 Non-HI Nutritional deficiencies 280 526 824 176518.269558159 366835.344079135 603667.296588944 1.00319109477991 1.86585102294944 2.922051700565 1.52391053296193 3.14661291117365 5.16538198113286
208 Central Europe, Eastern Europe, and Central Asia Sexually transmitted diseases excluding HIV 1 24 749.049999999999 166.875803571429 5929.17827112827 182459.186835163 0.0165261940175178 0.400407670277349 11.8303974788526 0.0110481010551772 0.394729798573915 11.8976053344826
209 High-income Sexually transmitted diseases excluding HIV 53 380 8690.17499999997 22857.5318452381 175032.136396577 2827324.65798773 0.0862962836769168 0.61265064335957 13.5176398570119 0.11661247004485 0.892661430616718 13.9412886680823
210 Latin America and Caribbean Sexually transmitted diseases excluding HIV 4 30 574.025 566.3 8363.06279963138 116884.073604101 0.0943157111994775 0.702967822555451 12.8959200052413 0.0674929274135377 1.00490243915955 13.5860670546079
211 North Africa and Middle East Sexually transmitted diseases excluding HIV 9 62 1141.15 1255.96791871921 9784.32448064027 126780.337072547 0.116935155618113 0.775686673448627 13.7622244576364 0.150206226249769 1.18411104724781 14.5437344554034
212 South Asia Sexually transmitted diseases excluding HIV 2 25 624.124999999998 363.3125 7205.37192982456 321071.850485355 0.046866688242362 0.555161645697876 13.4156663365741 0.0197391501879189 0.392177927889733 16.3114886343986
213 Southeast Asia, East Asia and Oceania Sexually transmitted diseases excluding HIV 7 52 1162.05 2571.975 27110.8425371729 455596.186551868 0.0800732097918097 0.591651152057004 12.9089563486742 0.0795510923542207 0.840509549941607 13.6813361376645
214 Sub-Saharian Africa Sexually transmitted diseases excluding HIV 2 14 292.099999999999 260 12502.3809036658 494810.454359185 0.0856155224764216 0.635824151538218 12.462278057799 0.00741987864823555 0.358673597075859 13.6430043866867
215 All Sexually transmitted diseases excluding HIV 78 535 11855.275 35272.1 259527 4427139.675 0.0937486969405685 0.636242710504873 13.5760997575811 0.111549239924856 0.827887986175145 13.4567086636888
216 Non-HI Sexually transmitted diseases excluding HIV 28 185 3874.325 9593.4795676794 76582.2552523824 1678073.14798159 0.0992194611234593 0.654218440356294 13.2150211944388 0.082193341661143 0.654420890871998 13.5457787568265
217 Central Europe, Eastern Europe, and Central Asia All 5767.975 6005 6206 1410252.68192944 1484634.7634048 1545138.42728806 NA NA NA NA NA NA
218 High-income All 58034.95 60631 62973.075 17965002.7381328 18964732.7669937 19913082.6031464 NA NA NA NA NA NA
219 Latin America and Caribbean All 3960 4135 4288 722593.839865011 797066.090539088 846449.76662953 NA NA NA NA NA NA
220 North Africa and Middle East All 7520.975 7863 8176 728226.625801279 771648.020121715 843574.472180716 NA NA NA NA NA NA
221 South Asia All 4145 4343 4517 1557591.67986569 1833915.30197979 2141590.444162 NA NA NA NA NA NA
222 Southeast Asia, East Asia and Oceania All 8087 8448 8763 2649547.45322001 2951844.43388339 3256999.37057224 NA NA NA NA NA NA
223 Sub-Saharian Africa All 2119 2213 2294 2827975.53465084 3265227.67385529 3642624.48396278 NA NA NA NA NA NA
224 All All 78661.775 82179 85358.2 28545370.475 30082791 31513723.075 NA NA NA NA NA NA
225 Non-HI All 26404.975 27564 28597.075 10376596.3427025 11117752.0874409 11813323.0799087 NA NA NA NA NA NA
In [ ]:
Content source: iatal/RCTvsBurden
Similar notebooks: