/
05_Quantification_MS_Rev.Rmd
1926 lines (1576 loc) · 112 KB
/
05_Quantification_MS_Rev.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: How many mosquito nets are needed to maintain universal coverage - an update
author:
- Hannah Koenker^[Tropical Health LLP, Baltimore, USA, hannah@trophealth.com, corresponding author]
- Josh Yukich^[Tulane University Center for Applied Malaria Research and Evaluation, New Orleans, USA, jyukich@tulane.edu]
- Marcy Erskine^[International Federation of Red Cross and Red Crescent Societies, Geneva, Switzerland, marcy.erskine@ifrc.org]
- Robert Opoku^[International Federation of Red Cross and Red Crescent Societies, Nairobi, Kenya, robert.opoku@ifrc.org]
- Eleanore Sternberg^[Tropical Health LLP, Liverpool, UK, eleanore@trophealth.com] # with distill_article can use name affiliation etc details
- Albert Kilian^[Tropical Health LLP, Montagut, Spain, albert@trophealth.com]
output:
bookdown::word_document2:
fig_caption: yes
number_sections: no
line_numbers: yes
reference_docx: "drdanholmes-ref-word.docx"
# reference_docx: "doc/Malaria Journal Article Template.docx"
# abstract: |
# keywords:
# journal: "Malaria Journal"
date: Draft of `r format(Sys.time(), '%d %B, %Y')` for submission
classoption: review, 3p
bibliography: quant_paper/quantbibfile.bib
biblio-style: quant_paper/model6-num-names
# fontsize: 11pt
# mainfont: Times New Roman
# natbiboptions: longnamesfirst,angle,semicolon
linenumbers: false
numbersections: false
preprint: false
csl: https://www.zotero.org/styles/biomed-central
header-includes:
- \usepackage{floatrow}
- \usepackage{caption}
- \floatsetup[figure]{capposition=top}
- \floatplacement{figure}{H}
- \usepackage{setspace}\doublespacing
- \biboptions{sort&compress}
# rticles::elsevier_article:
# latex_engine: xelatex
# keep_tex: true
# citation_package: natbib
editor_options:
chunk_output_type: console
---
```{r setup, echo=FALSE, include=FALSE}
######################
# Load Libraries
######################
# Load reading and basic libraries
library(rticles)
library(tidyverse)
library(haven)
library(readxl)
library(janitor)
library(viridis)
library(broom)
library(english)
library(magrittr)
library(lubridate)
library(countrycode)
library(data.table)
library(todor)
# Load map related libraries
library(sf)
library(tmap)
library(maptools)
library(maps)
library(spData)
library(distill)
library(geofacet)
# Load tables and plot libraries
library(flextable)
library(scales) # for heatmap in flextable
library(officer) # for setting color of vlines in flextable
library(gtsummary)
library(gt)
library(jtools)
library(kableExtra)
library(float)
library(ggstance)
library(knitr)
library(stringr)
library(stringi) # for removing accents from country names
library(ggpubr) # includes ggarrange and cowplot
library(patchwork) # for insetting plots and nicer combos than ggarrange and cowplot, somehow
library(ggrepel)
# Load QR libraries
library(quantreg)
library(splines)
##### Might need to reinstall pandoc, if so, run this from Terminal. Takes a few minutes:
# brew install pandoc
# brew install pandoc-citeproc
# brew install pandoc-crossref
######
######################
# Set figure theme and colors
######################
theme_set(theme_classic())
# scale_colour_continuous <- function(...) scale_color_brewer(palette = "RdBu")
# scale_colour_discrete <- function(...) scale_color_brewer(palette = "Set2") #
# scale_colour_binned <- function(...) scale_color_fermenter(palette = "Set3")
# scale_fill_continuous <- function(...) scale_fill_brewer(palette = "RdBu") #
# scale_fill_discrete <- function(...) scale_fill_brewer(palette = "Set3") #
# scale_fill_binned <- function(...) scale_fill_fermenter(palette = "Set3")
######################
# Knitr options
######################
knitr::opts_chunk$set(
echo = FALSE,
message=FALSE,
warning=FALSE,
tab.cap.style = "Caption") # set the table caption style so that Word can apply the right style! otherwise it's just normal.
## , dev="cairo_pdf")
options(knitr.kable.NA = "")
# knitr::opts_chunk$set(fig.pos = "!H", out.extra = "")
# knitr::opts_chunk$set(echo = FALSE, message=FALSE, warning=FALSE, dev="cairo_pdf", fig.width=7, fig.height=3.5)
# reason_palette <- c("net used"=rgb(102,194,165, maxColorValue=255), "objective" = rgb(141,160,203, maxColorValue=255), "subjective" = rgb(252,141,98, maxColorValue=255), "risk perception" = rgb(231,138,195, maxColorValue=255), "net attributes" = rgb(229,196,148, maxColorValue=255), "extra" = rgb(166,216,84, maxColorValue=255), "fears" = rgb(255,217,47, maxColorValue=255), "other"="lightgray")
```
# Abstract
Background
Insecticide treated nets (ITNs) have served as the cornerstone of malaria vector control in sub-Saharan Africa for the past two decades. Over 2.5 billion ITNs have been delivered since 2004 primarily through periodic mass distribution campaigns scheduled at approximately three-year intervals, aligning with the expected lifespan of nets. Recent work indicates that ITN retention times are less than two years in most countries, raising key questions for quantification approaches and delivery frequency for ITN distribution. This paper models several quantification approaches for five typical ITN distribution strategies, estimates the proportion of the population with access to an ITN, and presents recommended quantification approaches to meet global targets for ITN access and use.
Methods
A stock and flow model with annual timesteps was used to model ITN distribution and resulting ITN access for 2020-2035 under five scenarios in 40 countries: 1) three-year mass campaigns, 2) full-scale annual continuous distribution, 3) three-year mass campaigns plus continuous distribution in the years between campaigns, 4) three-year mass campaigns at different quantification approaches, 5) two-year mass campaigns at different quantification approaches. All scenarios included ITN distribution to pregnant women at antenatal clinics and infants at immunization visits.
Results
The current status quo of conducting mass campaigns every three years using a population/1.8 quantifier is insufficient to achieve or maintain targets of 80% population access to ITNs in most malaria-endemic countries, given most estimated retention times are less than three years. Tailored three- or two-year mass campaigns were less efficient than annual continuous distribution strategies in nearly all settings. For countries with at least 2.5 year median ITN retention times, full scale continuous distribution provided better ITN access while needing 6%-14% fewer ITNs compared to current mass campaigns.
Conclusion
Given variation in ITN retention times across countries, tailored quantification approaches for mass campaigns and continuous distribution strategies are warranted. Continuous distribution strategies are likely to offer more efficient ways to maintain ITN coverage, with fewer nets, where ITN retention times are at least two and a half years. National malaria programmes and their funding partners should work to increase the number of ITNs available to those vulnerable to malaria, while at the same time working to extend the useful life of these critical commodities.
# Background
Insecticide-treated nets (ITNs) have served as the cornerstone of malaria vector control in sub-Saharan Africa for the past two decades. Over 2.5 billion ITNs have been delivered to countries since 2004 [@Milliner:2016um], primarily through periodic mass distribution campaigns scheduled at approximately three-year intervals, aligning with the expected lifespan of nets. Recent work has shown significant variation in ITN durability across geographic zones, and while some studies support a three-year median lifespan, multi-country analyses of ITN retention times indicate half of countries can expect two years or less of useful life for the majority of nets they distribute [@10.1038/s41467-021-23707-7]. The shorter-than-expected retention times have important implications for the way countries quantify ITN commodity needs for mass campaigns, and raise several key questions. First, what is the projected impact of the mismatch in campaign cycle and ITN retention in terms of overall ITN coverage? Second, if mass campaigns every three years are insufficient due to ITNs lasting only one to two years, is switching to a two-year campaign cycle indicated, or are there alternative or supplemental ways to distribute ITNs to ensure high rates of ITN access are maintained over time? Third, with what is now known about ITN retention and ITN distribution modalities, is "population divided by 1.8" (as recommended since 2010 [@Kilian:2010im; @WorldHealthOrganization:2019ws]) the correct quantification approach for mass campaigns for all countries? Finally, what would optimum ITN quantification look like for countries given their particular ITN retention times, aiming to sustain high levels of ITN access (the necessary, but not sufficient, precursor to ITN use)?
```{r oddhh}
odd <- read_dta("/Users/hannahkoenker/Dropbox/A DHS MIS Datasets/Analysis/Caps/hh size and quant factors v5.dta") %>%
clean_names() %>%
select(percentodd)
```
In practical terms, quantification for ITN distribution has referred to a process whereby national malaria programmes estimate the number of ITNs required for mass campaigns by dividing the total population (or population living within areas targeted for the ITN campaign) by 1.8, which is intended to achieve an end result of households owning one ITN for every two people. The quantifier 1.8 was selected to account for the `r round(min(odd)*100, digits=1)`-`r round(max(odd)*100, digits=1)`% of households who have an odd number of household members, reflecting the need to round up the number of ITNs allocated to households in these cases [@Kilian:2010im]. Kilian et al. originally recommended dividing by 1.6, in order to accommodate distribution challenges including outdated census information and the need to preposition full bales of nets rather than precisely subdividing them. In practice, the World Health Organization (WHO) recommends "population divided by 1.8", and allows a buffer of up to 10% when the previous census is over five years old.
Continuous distribution (CD) is the delivery of ITNs on an annual or continuous basis, typically through school-based distribution or through community volunteers who deliver coupons to eligible families on demand, that can then be redeemed for ITNs at health facilities or other community storage points. Continuous distribution can occur at a limited scale between mass campaigns to offset losses of nets, as in Ghana, or at full-scale as a replacement for mass campaigns, as in Tanzania. The goal of continuous distribution strategies is to maintain high rates of population ITN access more consistently throughout a given three-year period, in contrast to campaigns whose cohorts of nets wear out en masse in a given geographic area [@Koenker:2013ed]. Regardless of whether mass campaigns and/or continuous distribution channels are used, the WHO recommends implementing ITN distribution to pregnant women and infants as a routine intervention [@WorldHealthOrganization:2019ws].
Quantification for continuous ITN distribution lacks a simple "population divided by X" quantifier. It is most straightforward for distribution to pregnant women and infants, as a) these populations are relatively consistent at around 4-5% and 4% of the population in sub-Saharan Africa at any given time, respectively [@10.1371/journal.pmed.1000221], and b) attendance rates at antenatal care visits (ANC) and immunization visits (EPI) are generally well-monitored through the national health management information system (HMIS). Annual procurements of ITNs for these channels are thus quite predictable. However, for ITN distribution through schools or community channels, quantification has been particularly challenging. The first large-scale pilots of these channels relied on modelling with NetCALC [@Koenker:2013ed], running individual scenarios to fine-tune the number of nets that would produce desired levels of ITN access. No rule of thumb quantifier was produced. It is likely that this gap has contributed in part to the limited scale-up of continuous distribution channels across malaria-endemic countries.
This paper explores the above questions using an existing stock and flow model [@10.1186/s12936-022-04272-w] to project population ITN access for countries in sub-Saharan Africa over five different distribution scenarios, using estimated ITN retention times from Bertozzi-Villa *et al.* [@10.1038/s41467-021-23707-7] and varying quantification approaches within each distribution scenario. Recommended quantifiers for each country are presented for each scenario and at different target levels of population ITN access.
# Methods
## Projections of future coverage
ITNs were distributed in the model for each scenario as shown in Table \@ref(tab:table1).
```{r table1, tab.cap = "Distribution Scenarios and their ITN inputs through mass campaign, routine (ANC/EPI), and continuous (school or community) channels. Population refers to the total population living in areas targeted for ITNs."}
scentable <- read_excel("data/scenario_table_text.xlsx", sheet = "pop times")
ftscen <- flextable(scentable) %>%
set_table_properties(layout = "autofit") %>%
theme_vanilla %>%
add_footer_lines("Note: ANC: antenatal care; EPI: expanded program on immunization; CD: continuous distribution") %>%
# add_header_row(values=c("","ITN delivery channel",""), colwidths=c(1,3,1)) %>%
align(
i = 1,
j = 2,
align = c("center"),
part = "header"
) %>%
fontsize(size=10, part="all")
# add_header_row(top = TRUE, values = c("", "2010", "2011"), colwidths = c(1,3,3))
ftscen
invisible(save_as_image(ftscen, path="figs/Tab_ScenariosTable.png"))
## Pull the total number of scenarios/and models:
totalscenarios <- scentable %>%
select(`Number of different models per scenario`) %>%
slice_max(`Number of different models per scenario`) %>%
pull()
```
For each year, the stock and flow model used a country-specific estimated median lifespan from Malaria Atlas Project (MAP) estimates published in Bertozzi-Villa *et al.* [@10.1038/s41467-021-23707-7], shown in blue in Fig. \@ref(fig:ret-decay-fig)A, to decay each crop of distributed nets in one-year time steps. Fig. \@ref(fig:ret-decay-fig)A also presents estimated median lifespans from ITN durability monitoring (DM) activities gathered from U.S. President's Malaria Initiative reports (www.pmi.gov) and published literature [@Abilio:2020fl; @Kilian:2020dj; @Mansiangi:2020cv; @Haji:2020de; @Obi:2020eza; @Kilian:2015hk; @10.1371/journal.pmed.1003248; @Randriamaherijaona:2017fo]. The net decay functions rely on smooth-compact loss function developed by Nakul Chitnis and described in Koenker *et al.* and Bhatt *et al.* [@Koenker:2013ed; @Bhatt:2015gn; @10.1186/s12936-022-04272-w], and are shown in Fig. \@ref(fig:ret-decay-fig)B. Each country was assigned an indicative population of 10 million people in the database, starting in 2020, and an annual population growth rate of 3%, as the model outputs are adjusted for population and thus do not require specific population estimates. The model was built and run in Stata (17, StataCorp LLC, College Station, TX).
```{r dmmap}
## Read in MAP retention times
ls <- read_excel("data/MAP_retentiontime_DM_medianlifespan.xlsx", sheet="Sheet1") %>%
clean_names() %>%
filter(type=="MAP") %>%
filter(country!="Myanmar") %>%
drop_na(country) %>%
rename(lifespan=median_retention_years) %>%
separate(x95_percent_ci, into = c("lb", "ub"),
sep = "\\s*(–|-)\\s*", convert = TRUE) %>%
select(-site) %>%
mutate(iso3=countrycode(country, origin="country.name", destination="iso3c"))
dm <- read_excel("../DM Maps/Median lifespan DM multisite.xlsx") %>%
clean_names() %>%
filter(country!="Myanmar") %>%
rename(lifespan=medianlifespan) %>%
separate(x95_percent_ci, into = c("lb", "ub"),
sep = "\\s*(–|-)\\s*", convert = TRUE) %>%
drop_na(lifespan) %>%
select(country, lifespan, lb, ub) %>%
mutate(type="DM",
country=case_when(country=="Democratic Republic of Congo" ~ "DRC",
TRUE ~ as.character(country)))
lsdm <- ls %>%
bind_rows(dm) %>%
mutate(iso3=countrycode(country, origin="country.name", destination="iso3c"))
# %>%
# mutate(iso3=case_when(type=="MAP" ~ as.character(iso3)))
levels <- lsdm$country[ls$type=='MAP'][rev(order(ls$lifespan[ls$type=='MAP']))]
lsdm$country_ord <- factor(lsdm$country, levels = levels)
# ls <- ls %>%
# mutate(iso3=countrycode(country, origin="country.name", destination="iso3c"))
levels3 <- lsdm$iso3[ls$type=='MAP'][rev(order(ls$lifespan[ls$type=='MAP']))]
lsdm$iso3ord <- factor(lsdm$iso3, levels = levels3)
# lsdm <- lsdm %>%
# mutate(iso3ord=if_else(is.na(iso3ord), countrycode(country, origin="country.name", destination="iso3c"), iso3ord))
# lsdm <- lsdm %>%
# mutate(iso3ord=countrycode(country_ord, origin="country.name", destination="iso3c"))
# save a small version of retention times for joining into results tables:
rettimes <- lsdm %>%
filter(type=="MAP") %>%
mutate(name=case_when(country=="Burkina" ~ "Burkina Faso",
# country=="Cote d'Ivoire" ~ "Côte d'Ivoire",
country=="Congo (Republic of)" ~ "Rep. Congo",
TRUE~as.character(country))) %>%
dplyr::select(-type, -country, -lb, -ub, -both, -country_ord, -iso3ord) %>%
mutate(name=stri_trans_general(name,"Latin-ASCII")) %>% # remove o-hat from Cote d'Ivoire
mutate(iso_a2 = countrycode(name, origin = "country.name", destination = "iso2c"))
a2levels <- rettimes$iso_a2 # make a list of the isoa2 countries included in retention times for later
dmmap <- lsdm %>%
ggplot() +
geom_point(aes(
y = lifespan,
x = iso3ord,
color = type,
alpha = type,
shape = type)) +
# ,
# alpha=0.8)
geom_linerange(aes(
x = iso3ord,
ymin = lb,
ymax = ub,
color = type
# alpha = both
),
alpha=0.8) +
theme_classic() +
scale_alpha_discrete(range=c(1,1), guide="none") +
# scale_alpha_continuous(range = c(0.25, 1), guide = "none") +
scale_color_hue(
# scale_color_brewer(palette="Set2",
name = "Study Type",
labels = c("DM", "MAP")) +
scale_shape_manual(
name = "Study Type",
labels = c("DM", "MAP"),
values = c(1, 2)
) + # if guide=="none" here, shape won't appear correctly in legend
# geom_text(aes(
# y=lifespan,
# x=country_ord,
# color=type,
# label=iso3),
# size=1.5,
# ) +
theme(legend.position="right",
text = element_text(size = 9),
axis.title.y = element_text(size=8),
axis.text.x = element_text(
angle = 45,
vjust = 1,
hjust = 1,
size = 6
)) +
# axis.text.x=element_blank()) +
labs(x = "",
y = "Retention / median lifespan (years)") +
scale_y_continuous(breaks=seq(0,6, by=1))
# dmmap
ggsave("figs/MAP_vs_DM_lifespans.png", width=6, height=5, dpi=300)
```
```{r dmcurves}
### Graphing Stata Decay Curves in GGPLOT ####
# tz <- read_dta("/Users/hannahkoenker/Dropbox/A DHS MIS Datasets/Analysis/Decay Curves/tz_decay_only.dta")
curves <- read_dta("/Users/hannahkoenker/Dropbox/A DHS MIS Datasets/Analysis/Decay Curves/curves_only.dta") %>%
filter(lifespan<5.5)
decay <- ggplot() +
geom_line(
data = curves,
aes(
x = tdist,
y = percsurv,
color = as.factor(lifespan),
linetype = as.factor(lifespan)
),
alpha = 0.4
) +
# geom_ribbon(
# data = tz,
# aes(x = tdist, ymin = lower, ymax = upper, fill="95% CI"),
# # fill = "lightgrey",
# alpha = 0.7
# ) +
# geom_line(data = tz, aes(x = tdist, y = percsurv), color = "orange") +
theme_minimal() +
theme(
panel.grid.minor = element_blank()
) +
# scale_fill_manual(name="Tanzania \n estimate", values="lightgrey") +
scale_color_manual(
name = "Median \nLifespan \n(years)",
values = c(
"dodgerblue",
"dodgerblue",
"red",
"red",
"seagreen",
"seagreen",
"darkorchid",
"darkorchid",
"pink"
)
) +
scale_linetype_manual(name = "Median \nLifespan \n(years)", values = c(1, 2, 1, 2, 1, 2, 1, 2, 1)) +
scale_x_continuous(breaks=seq(0,9,1)) +
theme(legend.position="right",
text = element_text(size = 9)) +
labs(
y = "Percent of nets surviving",
x = "Years since distribution",
# title = "Net decay curves for \n varying median lifespans",
color = "",
fill=""
)
# decay
ggsave("figs/decay_curves.png", width=6, height=5, dpi=300)
```
```{r npcaccess}
## rerun Script 01 to obtain the dataframes needed below:
source("01_NPC_to_ITN_access.R", local = knitr::knit_global())
### Make G into a dataframe and rename the variables for ggplot later:
gg <- as.data.frame(G) %>%
mutate(access=V2,
lb=V1,
ub=V3) %>%
arrange(access) %>%
mutate(npc=1:n()/100) %>% # make a new variable which is the row count and also NPC because Dad did not include this!
mutate(delta=ub-lb)
npc <- ggplot() +
geom_point(data=B, aes(x,y), alpha=0.5, shape=1, size=0.5) +
geom_line(data=gg, aes(npc, access)) +
geom_line(data=gg, aes(npc, lb, color="50% confidence bounds")) +
geom_line(data=gg, aes(npc, ub, color="50% confidence bounds")) +
theme_minimal() +
theme(legend.position="bottom",
text = element_text(size = 9)) +
labs(x="ITNs per capita (NPC)",
y="% ITN Access",
color="")
npchh <- fithhsize %>%
mutate(npcd=npc/100)
write_csv(npchh, "output/npchh.csv", col_names = TRUE)
write_csv(B, "output/B.csv", col_names = TRUE)
npchh %>%
ggplot() +
geom_point(data=B, aes(x, y), color="lightgray", alpha=0.8, shape=1, size=1) +
geom_line(aes(npcd, V2, color=as.factor(hhsize), linetype=as.factor(hhsize), group=hhsize)) +
geom_ribbon(aes(npcd, ymin=V1, ymax=V3, fill=as.factor(hhsize), group=hhsize), alpha=0.3) +
labs(x="ITNs per capita",
y="Estimated ITN access",
color="Mean\nhousehold\nsize")+
scale_color_brewer(palette="Dark2",
labels=c("<4","4-4.9","5-5.9","≥6")) +
scale_fill_brewer(palette="Dark2", labels=c("<4","4-4.9","5-5.9","≥6")) +
scale_linetype(labels=c("<4","4-4.9","5-5.9","≥6")) +
theme(legend.position="right",
text = element_text(size = 9)) +
# guides(fill="none") +
labs(color="Mean household size", linetype="Mean household size", fill="Mean household size")
# npchh
ggsave("figs/npc_hhsize.png", width=6, height=5, dpi=300)
```
```{r ret-decay-fig, fig.width = 7, fig.height = 6, out.width="80%", fig.cap = "A) ITN retention times estimated by Malaria Atlas Project (MAP) and median lifespans estimated from durability monitoring (DM) studies; countries are labeled by IS03 code. B) Smooth-compact loss function for net decay C) Nonparametric conditional quantile function for ITN access as a function of nets-per-capita (NPC)"}
dmmap / (decay | npchh) +
plot_annotation(tag_levels = 'A')
ggsave("figs/Fig_Retention_Decay_NPC.png", width=6, height=5, dpi=300)
```
```{r afpop}
## Extract Africa population data from UN WPP 2022 Demographic Indicators Medium File (https://population.un.org/wpp/Download/Standard/CSV/)
afpop <- as.data.frame(read_csv("data/WPP2022_Demographic_Indicators_Medium.csv")) %>%
clean_names() %>%
select(iso2_code, iso3_code, location, t_population1july, time) %>%
mutate(t_population1july=t_population1july*1000) %>%
rename(pop=t_population1july,
year=time,
iso_a2=iso2_code,
country_code=iso3_code,
country_name=location) %>%
filter(year>2019 & year<2041) %>%
filter(iso_a2 %in% a2levels) %>%
pivot_wider(names_from=year, names_prefix="x", values_from=pop)
```
The total net crop (consisting of all surviving nets from various channels to date) was summed for each year and country. This was then divided by the projected population to calculate nets-per-capita (NPC). To estimate ITN access from NPC, a nonparametric conditional quantile function for ITN access as a function of NPC was estimated from `r length(unique(Ddta$dataset))` Demographic and Health Surveys (DHS) and Malaria Indicator Surveys (MIS), stratifying by average household size, using the "quantreg" R package (v5.93; Koenker 2022) [@10.2307/1913643; @10.1257/jep.15.4.143; @10.1017/CCOL0521845734.007]. A grid of 100 points was produced and used to predict ITN access from NPC (Fig. \@ref(fig:ret-decay-fig)C). Confidence intervals for both estimated median lifespan and the function of ITN access vs NPC were used to generate an overall confidence interval around the estimate of ITN access.
Recommended quantifiers were obtained by identifying the scenario that provided the greatest number of years of ITN access at or above the target level; if multiple scenarios provided the same number of years, the scenario requiring the fewest nets was selected.
## Scenarios
To inform recommendations for quantification of ITNs, the above process was used to model ITN distributions under five typical ITN distribution scenarios, varying quantification approaches within each scenario. The majority of malaria-endemic countries currently implement Scenario 1; Tanzania has implemented Scenario 2 since 2013 in a subset of regions, while Ghana has implemented Scenario 3 since 2012. While countries aim to deliver mass campaigns every three years, some have recently argued for campaign every two years to offset shorter median net lifespans.
1. “Status quo”: Mass campaigns every three years with routine distribution of ITNs to pregnant women and infants through antenatal clinics (ANC) and immunization visits (EPI). Quantification of the mass campaigns was fixed at population / 1.8 while quantification of routine distribution varied from population x 5%-7%.
2. “Full-scale continuous”: Full-scale annual school distribution of ITNs with routine distribution of ANC and EPI ITNs, fixing the routine distribution at population x 6% and varying the quantification of school distributions from population x 0-50%
3. “Mass plus continuous”: Mass campaign every three years with ongoing routine distribution of ANC and EPI ITNs and with annual school distribution in a limited number of classes (or limited community distribution) in the years between campaigns. Quantification of the mass campaigns was fixed at population / 1.8 and routine distribution at population x 6%, varying the annual school/community distribution between population x 0-40%.
4. “Varying three-year mass”: Mass campaigns every three years with routine distribution of ITNs to pregnant women and infants through ANC and EPI. Quantification of routine distribution was fixed at 6%, and quantification of the mass campaigns was varied from population / 0.1 (ten nets per person) to population / 2.0 (one net for two people) in increments of 0.1.
5. “Varying two-year mass”: Mass campaigns every two years with routine distribution of ITNs to pregnant women and infants through ANC and EPI. Quantification of routine distribution was fixed at 6%, and quantification of the mass campaigns was varied from population / 0.5 (two nets per person) to population / 2.0 (one net for two people) in increments of 0.1.
All scenarios with mass campaigns began with a mass campaign in 2022 and ended in 2035. The “full scale continuous” scenario assumed a mass campaign in 2020, quantified with population / 1.8, to scale up coverage prior to switching over to a fully continuous ITN strategy.
To assess feasibility of large-scale school distribution in relation to optimal quantifiers, the proportion of the population that are primary school students currently attending school was calculated from the most recent DHS for each country, obtained with permission from dhsprogram.com.
# Results
```{r readmins}
s2min <- read_dta("data/s2_min_npp.dta") %>%
clean_names()
s3min <- read_dta("data/s3_min_npp.dta") %>%
clean_names()
s4min <- read_dta("data/s4_min_acc.dta") %>%
clean_names()
s5min <- read_dta("data/s5_min_acc.dta") %>%
clean_names()
## Grab the low and high quantifiers for Scenario 2 for results inline code
s2_70_low <- s2min %>%
filter(target==70) %>%
top_n(1, -q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s2_70_high <- s2min %>%
filter(target==70) %>%
top_n(1, q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s2_80_low <- s2min %>%
filter(target==80) %>%
top_n(1, -q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s2_80_high <- s2min %>%
filter(target==80) %>%
top_n(1, q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s2_90_low <- s2min %>%
filter(target==90) %>%
top_n(1, -q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s2_90_high <- s2min %>%
filter(target==90) %>%
top_n(1, q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
## Grab highs and low quantifiers from the Scenario 3 targets:
s3_70_low <- s3min %>%
filter(target==70) %>%
top_n(1, -q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name")) %>%
left_join(rettimes)
s3_70_high <- s3min %>%
filter(target==70) %>%
top_n(1, q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s3_80_low <- s3min %>%
filter(target==80) %>%
top_n(1, -q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s3_80_high <- s3min %>%
filter(target==80) %>%
top_n(1, q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s3_90_low <- s3min %>%
filter(target==90) %>%
top_n(1, -q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
s3_90_high <- s3min %>%
filter(target==90) %>%
top_n(1, q) %>%
mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name"))%>%
left_join(rettimes)
shortlist2 <- c("LR","GN","TZ","TG","CG","CM")
shortlist3 <- c("LBR","GIN","TZA","TGO","COG","CMR")
```
Given a target of 80% ITN access, the recommended quantification approaches for each scenario varied considerably across countries. Adjustments in quantification for ANC-EPI distribution did not lead to large differences in ITN access in Scenario 1. The key factors driving variation across countries within a given scenario were the estimated retention times for each country and the mean household size. Recommended quantification approaches are summarized for the scenarios that include continuous distribution in Table \@ref(tab:table-min-quantifier), for three-year mass campaigns in Table \@ref(tab:tabscen4), and for two-year mass campaigns in Table \@ref(tab:tabscen5). Six countries are included in these tables representing a range of ITN retention times from one year to three and a half years at approximately half-year intervals. The complete tables including all countries are available in the Supplemental Material.
For Scenario 2, which relies on full-scale annual continuous distribution in combination with routine ANC/EPI ITN delivery to maintain access, the annual quantifier needed to maintain ITN access at 70% ranged from `r s2_70_low$q[1]`% of the population in `r s2_70_low$country[1]` (estimated net retention time of `r s2_70_low$lifespan[1]` years), to `r s2_70_high$q[1]`% of the population in `r combine_words(s2_70_high$country)` (retention times of `r combine_words(s2_70_high$lifespan)` years, respectively). Similarly, to maintain ITN access at 80%, the quantifier ranged from `r s2_80_low$q[1]`% of the population in `r s2_80_low$country[1]`, to `r s2_80_high$q[1]`% of the population in `r s2_80_high$country[1]`. For ITN access to be maintained at 90% required a quantifier of between `r s2_90_low$q[1]`% of the population in `r s2_90_low$country[1]` (retention time of `r s2_90_low$lifespan[1]` years) and `r s2_90_high$q[1]`% of the population in `r combine_words(s2_90_high$country)` (`r s2_90_high$lifespan[1]` years retention time; Table \@ref(tab:table-min-quantifier)).
For Scenario 3, where mass campaigns are conducted every three years, routine distribution of ITNs through ANC/EPI is conducted consistently, and continuous distribution supplements ITN access in the years between campaigns, there was also a range of quantifiers for the annual continuous distribution channels. At the 70% target, `r words(length(unique(s3_70_low$country)))` countries required ITNs equivalent to `r s3_70_low$q[1]`% of the population, essentially indicating that three-year campaigns with ANC and EPI distribution would maintain ITN access at 70%. For countries with the shortest retention times like `r s3_70_high$country[1]`, continuous distribution quantified using population x `r s3_70_high$q[1]`% was needed to maintain ITN access between campaigns. `r Words(length(unique(s3_80_low$country)))` countries were able to maintain the 80% access target with no continuous distribution ITNs between campaigns (`r combine_words(s3_80_low$country)`), while `r combine_words(s3_80_high$country)` was estimated to need `r s3_80_high$q[1]`% of the population in ITNs in each year between campaigns. `r combine_words(s3_90_low$country)`, with an estimated net retention time of `r s3_90_low %>% summarize(min(lifespan))` years, was the country with the lowest quantifier that maintained ITN access at 90% between campaigns, with population times `r s3_90_low$q[1]`% between campaigns. Table \@ref(tab:table-min-quantifier) summarizes the recommended quantifiers for six countries, to maintain ITN access at 70%, 80%, or 90%; full results are in the Supplemental Material.
```{r Quantifier_Table}
t2 <- s2min %>%
pivot_wider(names_from = target, values_from = q) %>%
relocate(`70`, .before = `80`) %>%
relocate(`90`, .after = `80`) %>%
#mutate(scenario = "s2")
rename("s270" = `70`,
"s280" = `80`,
"s290" = `90`)
t3 <- s3min %>%
pivot_wider(names_from = target, values_from = q) %>%
relocate(`70`, .before = `80`) %>%
relocate(`90`, .after = `80`) %>%
#mutate(scenario = "s3")
rename("s370" = `70`,
"s380" = `80`,
"s390" = `90`)
# join tables
table_q_s2s3long <- t2 %>%
left_join(t3, by = "iso_a2") %>%
arrange(iso_a2) %>%
left_join(rettimes) %>%
mutate(lifespan=round(lifespan, digits=1),
iso3=countrycode(iso_a2, origin="iso2c", destination="iso3c")) %>%
dplyr::select(iso3, lifespan, s270, s280, s290, s370, s380, s390) %>%
arrange(lifespan)
table_q_s2s3short <- table_q_s2s3long %>%
filter(iso3 %in% shortlist3)
```
```{r table-min-quantifier, tab.cap = "Recommended annual quantifiers for continuous distribution channels for six countries with a range of estimated ITN retention times; i.e. Togo should quantify the nets needed for full-scale continuous distribution by multiplying their population by 19%, each year, to maintain 80% ITN access. All scenarios assume that ANC and EPI delivery of ITNs is ongoing and provides nets to 6% of the population, in addition to any CD nets. The six countries shown here (labeled by IS03 code) represent the range of ITN retention times from 1 year to 3.5 years at approximately 6-month intervals. Results for all countries are available in the Supplemental Material. "}
std_border = fp_border(color="gray") ## set the color of the border needed later down
tables2s3function <- function(df) {
flextable(df) %>%
set_header_labels(
iso3 = "Country (ISO3 code)",
lifespan = "Retention time (years)",
s270 = "70%",
s280 = "80%",
s290 = "90%",
s370 = "70%",
s380 = "80%",
s390 = "90%"
) %>%
add_header_row(colwidths = c(2, 6),
values = c("", "Targeted ITN access level:")) %>%
add_header_row(
colwidths = c(2,3,3),
values = c("", "Scenario 2 (full continuous distribution strategy)", "Scenario 3 (continuous distribution between mass campaigns)")
) %>%
add_header_row(
colwidths = c(8),
values=c("Minimum quantifier (population x quantifier, annually) to sustain ITN access at or above specified target level")
) %>%
fontsize(size = 9, part = "body") %>%
fontsize(size=10, part="header") %>%
colformat_double(
j=3:8,
big.mark = ",",
digits = 0,
na_str = "",
suffix="%"
) %>%
theme_vanilla %>%
align(align = "center", part = "all") %>%
vline(j=5, border=std_border, part="all") %>%
vline(j=2, border=std_border, part="all") %>%
set_table_properties(width=.5)
}
t23 <- tables2s3function(table_q_s2s3short)
t23 <- t23 %>%
add_footer_lines(values="Note: Liberia has a blank value for Scenario 3 at the 90% ITN access target because the target level is not achievable in the model; it would require a quantifier greater than 40%")%>%
fontsize(size = 9, part = "footer")
t23
invisible(save_as_image(t23, path="figs/Tab_Scen23.png"))
```
```{r s45mindata}
s45colnames <- c("Cty","1.0","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","2.0")
examplecountry <- "GN" ## set the example country we want to use in the text here.
t4 <- read_dta("data/s4q.dta") %>%
rename(s4=best) %>%
mutate(s4=(s4-400)/10)
t5 <- read_dta("data/s5q.dta") %>%
rename(s5=best) %>%
mutate(s5=(s5-500)/10)
t4_18 <- s4min %>%
select(iso_a2, accrk418) %>%
filter(accrk418>=80) %>%
# mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name")) %>%
left_join(rettimes)
t4_16 <- s4min %>%
select(iso_a2, accrk416) %>%
filter(accrk416>=80) %>%
# mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name")) %>%
left_join(rettimes)
examplecty4 <- s4min %>%
filter(iso_a2==examplecountry) %>%
left_join(rettimes)
t5_18 <- s5min %>%
select(iso_a2, accrk518) %>%
filter(accrk518>=80) %>%
# mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name")) %>%
left_join(rettimes)
t5_16 <- s5min %>%
select(iso_a2, accrk516) %>%
filter(accrk516>=80) %>%
# mutate(country=countrycode(iso_a2, origin="iso2c", destination="country.name")) %>%
left_join(rettimes)
examplecty5 <- s5min %>%
filter(iso_a2=="LR") %>%
left_join(rettimes)
totcty <- s5min %>%
nrow() ## grab the total number of countries in the analysis
```
For Scenario 4, the quantifier used for three-year mass campaigns (in combination with routine ITN distribution at ANC/EPI clinics) was varied from 0.1 to 2.0. The lowest level of ITN access between campaigns is shown in Table \@ref(tab:tabscen4). Under the current recommended quantifier of 1.8, only `r t4_18$name[1]` and `r t4_18$name[2]`, both with net retention times of over three years, were estimated to maintain ITN access at or above 80% between campaigns. Even at population divided by 1.6, only `r words(length(unique(t4_16$name)))` countries (`r round(length(unique(t4_16$iso_a2))/totcty*100, digits=1)`% of countries in the sample) maintained ITN access above 80%, likewise all with net retention times of at least three years. In `r countrycode(examplecountry, origin="iso2c", destination="country.name")`, with the standard quantifier of population / 1.8 and an estimated retention time of `r examplecty4$lifespan[1]` years, the country reaches a low point of `r round(examplecty4$accrk418[1], digits=0)`% ITN access between campaigns. Using population / 1.1 would result in an estimated low point of `r round(examplecty4$accrk411[1], digits=0)`% population ITN access between campaigns.
```{r s4function-setup}
# colourer <- col_numeric(
# palette = scales::col_numeric(palette = paletteer::paletteer_d(palette = "Redmonder::dPBIRdGn") %>% as.character(),
# domain = NULL),
# domain = c(0, 100))
# bg_picker <- scales::col_bin(
# palette = scales::col_numeric(palette = paletteer::paletteer_d(palette = "Redmonder::dPBIRdGn") %>% as.character(),
# domain = NULL),
# domain = c(0, 100), # min and max range can be also set dynamically
# bins = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)) # bins
white_border= fp_border(color="white", width=2) ## set the color of the border needed later down
s4tablefunction <- function(df) {
flextable(df) %>%
set_header_labels(
iso3 = "Cty",
lifespan = "Retention time (years)",
# accrk405 = "0.5",
# accrk406 = "0.6",
# accrk407 = "0.7",
# accrk408 = "0.8",
# accrk409 = "0.9",
accrk410 = "1.0",
accrk411 = "1.1",
accrk412 = "1.2",
accrk413 = "1.3",
accrk414 = "1.4",
accrk415 = "1.5",
accrk416 = "1.6",
accrk417 = "1.7",
accrk418 = "1.8",
accrk419 = "1.9",
accrk420 = "2.0"
) %>%
add_header_row(colwidths = c(2, 11),
values = c("", "Population divided by:")) %>%
add_header_row(
colwidths = c(13),
values = c("Lowest ITN access between three-year campaigns for each quantifier")
) %>%
fontsize(size = 9, part = "all") %>%
colformat_double(
j=3:13,
big.mark = ",",
digits = 0,
na_str = ""
) %>%
bg(
bg = scales::col_numeric(palette = "RdYlGn", domain = c(0, 100)),
j = 3:13,
part = "body") %>%
theme_vanilla %>%
align(align = "center", part = "header") %>%
vline(j = c(10,11), border=white_border, part="body") %>%
set_table_properties(layout="autofit", width=.7)
}
```
```{r tabscen4, tab.cap = "Lowest level of ITN access between three-year campaigns at different population quantifiers. Routine ITN delivery to pregnant women and infants is assumed. The six countries shown here represent the range of ITN retention times from 1 year to 3.5 years at approximately 6-month intervals. Results for all countries are available in the Supplemental Material."}
s4minrtlong <- s4min %>%
left_join(rettimes) %>%
select(-name, -contains("accrk40")) %>%
mutate(lifespan=round(lifespan, digits=1),
iso3=countrycode(iso_a2, origin="iso2c", destination="iso3c")) %>%
select(-iso_a2) %>%
select(iso3, lifespan, everything())
s4minrtshort <- s4minrtlong %>%
filter(iso3 %in% shortlist3) %>%
arrange(lifespan)
tab4 <- s4tablefunction(s4minrtshort)
tab4
invisible(save_as_image(tab4, path="figs/Tab_Scen4.png"))
```
Table \@ref(tab:tabscen5) provides a similar picture but for campaigns conducted every two years. Under a population / 1.8 quantifier, `r words(length(unique(t5_18$name)))` countries (`r round(length(unique(t5_18$iso_a2))/totcty*100, digits=1)`%) including `r combine_words(t5_18$name)` would all maintain ITN access at or above 80% between campaigns. In other countries, two-yearly campaigns closer to one ITN per person would be needed in order to maintain ITN access at the 80% target. For example, Liberia reaches a low point of `r round(examplecty5$accrk518[1], digits=0)`% ITN access in the year between campaigns using population / 1.8. Using population / 1.0 (one net per person, every two years) would result in an estimated ITN access of `r round(examplecty5$accrk510[1], digits=0)`% between campaigns.
```{r s5tablefunction}
s5tablefunction <- function(df) {
flextable(df) %>%
set_header_labels(
iso3 = "Cty",
lifespan = "Retention time (years)",
accrk510 = "1.0",
accrk511 = "1.1",
accrk512 = "1.2",
accrk513 = "1.3",
accrk514 = "1.4",
accrk515 = "1.5",
accrk516 = "1.6",
accrk517 = "1.7",
accrk518 = "1.8",
accrk519 = "1.9",
accrk520 = "2.0"
) %>%
add_header_row(colwidths = c(2, 11),
values = c("", "Population divided by:")) %>%
add_header_row(
colwidths = c(13),
values = c("Lowest ITN access between two-year campaigns for each quantifier")
) %>%
fontsize(size = 9, part = "all") %>%
align(align = "center", part = "header") %>%
colformat_double(
j=3:13,
big.mark = ",",
digits = 0,
na_str = ""
) %>%
bg(
bg = scales::col_numeric(palette = "RdYlGn", domain = c(0, 100)),
j=3:13,
part = "body") %>%
theme_vanilla %>%
align(align = "center", part = "header") %>%
vline(j = c(10,11), border=white_border, part="body") %>%
set_table_properties(layout="autofit", width=.7)
}
```
```{r tabscen5, tab.cap = "Lowest level of ITN access between two-year campaigns at different population quantifiers. Values of 100 indicate excess nets in the system (for example Cameroon). Routine ITN delivery to pregnant women and infants is assumed. The six countries shown here represent the range of ITN retention times from 1 year to 3.5 years at approximately 6-month intervals. Results for all countries are available in the Supplemental Material."}
s5minrtlong <- s5min %>%
left_join(rettimes) %>%
select(-name, -contains("accrk50")) %>%
mutate(lifespan=round(lifespan, digits=1),
iso3=countrycode(iso_a2, origin="iso2c", destination="iso3c")) %>%
select(-iso_a2) %>%
select(iso3, lifespan, everything())
s5minrtshort <- s5minrtlong %>%
filter(iso3 %in% shortlist3) %>%
arrange(lifespan)
tab5 <- s5tablefunction(s5minrtshort)
tab5
invisible(save_as_image(tab5, path="figs/Tab_Scen5.png"))
```
The below figures illustrate scenario results for each country, for Scenario 1 (Fig. \@ref(fig:geo-facets-3ucc)), Scenario 2 (Fig. \@ref(fig:geo-facets-cd)), and Scenario 3 (Fig. \@ref(fig:geo-facets-cducc)), with predicted population ITN access estimates shown in green and target levels of ITN access highlighted in red at 80% and 90%. The typical rise and fall of ITN access is apparent in Fig. \@ref(fig:geo-facets-3ucc) and Fig. \@ref(fig:geo-facets-cducc), while ITN access is maintained at a steady rate in Fig. \@ref(fig:geo-facets-cd) where distributions are annual through continuous channels.
```{r grid}
geofacet_fname <- "data/geofacet_ssa.csv" # load geofaceting data for sub saharan africa
ssa_grid <- fread(geofacet_fname) # make it a grid for tiny maps in africa continent layout
s1title <- "3-year mass campaigns with ANC/EPI at "
s2title <- "ANC/EPI at 6% and annual school/community \ndistribution at "
s3title <- "3-year mass campaigns with ANC/EPI at 6% and \nbetween-campaign school/community distribution at "
s4title <- "3-year mass campaigns with ANC/EPI, \nat population / "
s5title <- "2-year mass campaigns with ANC/EPI, \nat population / "
s6title <- "2-year mass campaigns with ANC/EPI at "
```
```{r geofacet_function}
# read data in and plot
geofun <- function(scen, title) {
# splot <-
read_dta(filename) %>%
select(percpop, year, accrk, iso3, acclb_npclb, accub_npcub) %>%
mutate(name = countrycode(iso3, origin = "iso3c", destination = "country.name")) %>%
mutate(code = iso3) %>%
ggplot(aes(x = year - 2000)) +
geom_hline(yintercept = 80, size=0.25, linetype="solid", color = "red", alpha = 0.5) +
geom_hline(yintercept = 90, size=0.25, linetype="solid", color = "red", alpha = 0.5) +
# geom_line(aes(y = percpop, color = "percpop"), alpha = 0.5, size = 0.75) +
geom_line(aes(y = accrk, color = "accrk"), alpha = 0.5, size = 0.75) +
geom_ribbon(aes(ymin = acclb_npclb, ymax = accub_npcub),
color = NA,
alpha = 0.25) +
scale_color_brewer(
palette = "Dark2",
labels = c("Predicted \nITN Access")
) +
scale_x_continuous(breaks = seq(20, 35, 5),
labels = c("'20", "'25", "'30", "'35")) +
theme_minimal() +
facet_geo( ~ code, grid = ssa_grid, label = "code") +
labs(title = paste(title, X, "% of the population"),
x = "",
y = "Percent",
color = "") +
theme(
# legend.position="none",
# axis.text.x = element_text(angle=45, hjust=1)
# axis.text.x = element_blank(),
axis.line = element_blank(),
axis.ticks.x = element_blank(),
axis.text = element_text(size = 6),
panel.grid.major.x = element_line(color = "darkgrey", size =
0.25)
) +
scale_alpha(guide = 'none') +
scale_size(guide = 'none')
# print(splot)
# plotname <- paste("figs/scen_",scen,".pdf", sep = "")
# ggsave(plotname)
}
```
```{r geo-facets-3ucc, warning = FALSE, message=FALSE, fig.width = 7, fig.height = 6, out.width="80%", fig.cap = "Estimated ITN access under a typical three-year mass campaign strategy, with ANC/EPI distribution at 6% of the population annually. Red lines indicate 80% and 90% ITN access targets."}
s1 <- 106 ## set the scenario selected for inclusion in the paper
# create the path and filename from the scenario number
filename = paste("output/runs/", s1, ".dta", sep = "")
# extract the quantifier from scenario number (last two digits) to put into the titles
X <- s1-round(s1,digits=-2)
geofun(scen = s1, title = s1title)
ggsave("figs/geofacet_3ucc.png", width=6, height=5, dpi=300)
```
```{r geo-facets-2ucc, warning = FALSE, message=FALSE, fig.width = 7, fig.height = 6, out.width="80%", fig.cap = "Estimated ITN access under a typical two-year mass campaign strategy, with ANC/EPI distribution at 6% of the population annually. Red lines indicate 80% and 90% ITN access targets."}
s6 <- 606 ## set the scenario selected for inclusion in the paper
# create the path and filename from the scenario number
filename = paste("output/runs/", s6, ".dta", sep = "")
# extract the quantifier from scenario number (last two digits) to put into the titles
X <- s6-round(s6,digits=-2)
geos6 <- geofun(scen = s6, title = s6title)
ggsave(plot=geos6, "figs/geofacet_2ucc.png", width=6, height=5, dpi=300)
```
```{r geo-facets-cd, warning = FALSE, message=FALSE, fig.width = 7, fig.height = 6, out.width="80%", fig.cap = "Estimated ITN access with annual ANC/EPI at 6% and full continuous distribution strategy at 17% of the population in nets each year. Shaded areas indicate 95% confidence intervals accounting for both net retention times and ITN access as a function of nets-per-capita (NPC). Red lines indicate 80% and 90% ITN access targets."}
s2 <- 217 ## set the scenario selected for inclusion in the paper
# create the path and filename from the scenario number
filename = paste("output/runs/", s2, ".dta", sep = "")
# extract the quantifier from scenario number (last two digits) to put into the titles
X <- s2-round(s2,digits=-2)
geofun(scen = s2, title = s2title)
ggsave("figs/geofacet_cd17.png", width=6, height=5, dpi=300)
```
```{r geo-facets-cducc, warning = FALSE, message=FALSE, fig.width = 7, fig.height = 6, out.width="80%", fig.cap = "Scenario 3 - Estimated ITN access under three-year mass campaigns with ANC/EPI distribution at 6%, and between-campaign continuous distribution at 10%. Red lines indicate 80% and 90% ITN access targets."}
s3 <- 310 ## set the scenario selected for inclusion in the paper
# create the path and filename from the scenario number
filename = paste("output/runs/", s3, ".dta", sep = "")
# extract the quantifier from scenario number (last two digits) to put into the titles
X <- s3-round(s3,digits=-2)
geofun(scen = s3, title = s3title)
ggsave("figs/geofacet_cd10ucc.png", width=6, height=5, dpi=300)
```
The complete set of graphs for all `r totalscenarios` scenarios is included as Supplemental File 1.
```{r table-reccs}