-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
1216 lines (1087 loc) · 54.8 KB
/
README.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
---
output:
github_document:
pandoc_args: --webtex
always_allow_html: true
bibliography: Accessibility-Vaccination-Sites-Hamilton/references.bib
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# An examination of the accessibility implications of a pilot COVID-19 vaccination program in Hamilton, Ontario
<!-- badges: start -->
<!-- badges: end -->
Antonio Páez (McMaster University)
Christopher D. Higgins (University of Toronto Scarborough)
Findings (2020) https://doi.org/10.32866/001c.24082
## Abstract
The Government of Ontario in Canada announced the pilot for a new vaccination program, with designated pharmacies across the province now able to offer COVID-19 vaccines. The accessibility of this program raises questions about travel times to vaccination sites and the distribution of these times among the population. In our examination of the City of Hamilton we find that selected sites do not serve rural and urban residents well; particularly, the associated cost of travel (in terms of travel time) is expected to be disproportionally borne by lower income urban populations and rural residents. Modest additions to the list of pilot sites in the city can substantially alleviate this inequity.
## Keywords
- COVID-19
- Vaccination sites
- Accessibility
- Hamilton
- Ontario
- Reproducible research
```{r install-data-package, include = FALSE}
# Run only once if needed to install data package `vaccHamilton`
if (!require("vaccHamilton", character.only = TRUE)) {
devtools::install_github("https://github.com/paezha/Accessibility-Pharmacies-Hamilton-Vaccines",
subdir = "vaccHamilton")
}
```
```{r load-packages, include=FALSE, cache=FALSE}
#Load the packages needed to read and work with the data
library(grid)
library(gridExtra)
library(kableExtra)
library(patchwork)
library(png)
library(sf)
library(tidyverse)
library(units)
library(vaccHamilton) # Data package
```
```{r invoke-data, include=FALSE}
data("data_da_2016")
data("dwelling_network_points_2016")
data("hamilton_cma")
data("modes_55to69")
data("pharmacy_locations")
data("ttm_car")
data("ttm_transit")
data("ttm_walk")
data("urban_types")
```
```{r population-age-55-plus, include=FALSE}
# Data preparation
## Calculate number of people age 55+ per DA:
data_da_2016 <- data_da_2016 %>%
filter(`Region Name` == "Hamilton") %>%
mutate(Population_55to69 = (`v_CA16_208: 55 to 59 years` +
`v_CA16_226: 60 to 64 years` +
`v_CA16_247: 65 to 69 years`),
Population_70plus = (`v_CA16_265: 70 to 74 years` +
`v_CA16_283: 75 to 79 years` +
`v_CA16_301: 80 to 84 years` +
`v_CA16_319: 85 years and over`))
```
```{r select-pharmacies, include=FALSE}
# Data preparation
## Select pharmacy locations:
pharmacy_locations <- pharmacy_locations %>%
slice(1:23)
## Also filter selected pharmacies from travel time tables:
ttm_car <- ttm_car %>%
dplyr::filter(OBJECTID <= 23)
ttm_transit <- ttm_transit %>%
dplyr::filter(OBJECTID <= 23)
ttm_walk <- ttm_walk %>%
dplyr::filter(OBJECTID <= 23)
```
```{r clip-da-geometry, include=FALSE}
# Data preparation
## This is purely cosmetic: clip `data_da_2016`:
data_da_2016 <- data_da_2016 %>%
st_intersection(hamilton_cma)
```
```{r number-of-residential-units-per-DA, include=FALSE}
# Data preparation
## Find number of residential units in each DA. This is needed to assign the population to parcels
residential_units <- dwelling_network_points_2016 %>%
st_drop_geometry() %>%
group_by(DAUID) %>%
summarize(residential_units = sum(Dwellings))
```
```{r join-population-to-parcels, include=FALSE}
# Data preparation
## Join number of people age 55+ per DA to dwellings and total number of residential units:
dwelling_network_points_2016 <- dwelling_network_points_2016 %>%
left_join(data_da_2016 %>%
st_drop_geometry() %>%
dplyr::transmute(DAUID = GeoUID,
Population_55to69,
Population_70plus),
by = "DAUID") %>%
left_join(residential_units,
by = "DAUID")
```
```{r calculate-population-per-parcel, include=FALSE}
# Data preparation
##Calculate population per point on the network. This is the population in the DA divided by the total number of residential units. This gives the average number of people per residential unit. Then, multiply by the number of dwellings (residential units) at the point:
dwelling_network_points_2016 <- dwelling_network_points_2016 %>%
mutate(Population_55to69 = (Population_55to69/residential_units) * Dwellings,
Population_70plus = (Population_70plus/residential_units) * Dwellings)
```
```{r join-region-to-parcels, include=FALSE}
dwelling_network_points_2016 <- dwelling_network_points_2016 %>%
st_join(urban_types)
```
```{r calculate-population-statistics, include=FALSE}
population_statistics <- dwelling_network_points_2016 %>%
st_drop_geometry() %>%
dplyr::filter(!is.na(Type)) %>%
group_by(Type) %>%
summarize(Population_55to69 = sum(Population_55to69,
na.rm = TRUE),
Population_70plus = sum(Population_70plus,
na.rm = TRUE))
```
```{r join-population-data-to-travel-time-tables, include=FALSE}
# Data preparation
## Join the population data to the travel time matrices:
ttm_car <- ttm_car %>%
left_join(dwelling_network_points_2016 %>%
st_drop_geometry() %>%
dplyr::transmute(ID,
Population_55to69,
Population_70plus,
Urban_type = Type,
DAUID,
TAZUID),
by = c("UID" = "ID"))
ttm_transit <- ttm_transit %>%
left_join(dwelling_network_points_2016 %>%
st_drop_geometry() %>%
dplyr::transmute(ID,
Population_55to69,
Population_70plus,
Urban_type = Type,
DAUID,
TAZUID),
by = c("UID" = "ID"))
ttm_walk <- ttm_walk %>%
left_join(dwelling_network_points_2016 %>%
st_drop_geometry() %>%
dplyr::transmute(ID,
Population_55to69,
Population_70plus,
Urban_type = Type,
DAUID,
TAZUID),
by = c("UID" = "ID"))
```
```{r join-pharmacy-data-to-travel-time-tables, include=FALSE}
# Data preparation
## Join the pharmacy data to the travel time matrices:
ttm_car <- ttm_car %>%
left_join(pharmacy_locations %>%
st_drop_geometry() %>%
dplyr::select(ID,
Type),
by = c("OBJECTID" = "ID"))
ttm_transit <- ttm_transit %>%
left_join(pharmacy_locations %>%
st_drop_geometry() %>%
dplyr::select(ID,
Type),
by = c("OBJECTID" = "ID"))
ttm_walk <- ttm_walk %>%
left_join(pharmacy_locations %>%
st_drop_geometry() %>%
dplyr::select(ID,
Type),
by = c("OBJECTID" = "ID"))
```
```{r drop-missing-values, include=FALSE}
# Data preparation
## Drop parcels with missing values:
ttm_car <- ttm_car %>%
drop_na(TAZUID,
Population_55to69)
ttm_transit <- ttm_transit %>%
drop_na(TAZUID,
Population_55to69)
ttm_walk <- ttm_walk %>%
drop_na(TAZUID,
Population_55to69)
```
```{r proportion-of-trips-by-mode, include=FALSE}
# Data preparation
## Calculate proportion of trips by mode per TAZ:
modes <- modes_55to69 %>%
mutate(p_car = Driver/(Driver + Transit + Walk),
p_transit = Transit/(Driver + Transit + Walk),
p_walk = Walk/(Driver + Transit + Walk))
```
```{r complete-proportion-of-trips-by-mode, include=FALSE}
# Data preparation
## Assume that TAZ with NAs have a proportion of car trips of one:
modes <- modes %>%
dplyr::mutate(p_car = replace_na(p_car, 1),
p_transit = replace_na(p_transit, 0),
p_walk = replace_na(p_walk, 0))
```
```{r join-proportion-of-trips-to-travel-time-tables, include=FALSE}
# Data preparation
## Join proportion of trips by mode to travel time tables:
ttm_car <- ttm_car %>%
left_join(modes %>%
st_drop_geometry() %>%
transmute(TAZUID,
p_car,
p_transit,
p_walk),
by = "TAZUID")
ttm_transit <- ttm_transit %>%
left_join(modes %>%
st_drop_geometry() %>%
transmute(TAZUID,
p_car,
p_transit,
p_walk),
by = "TAZUID")
ttm_walk <- ttm_walk %>%
left_join(modes %>%
st_drop_geometry() %>%
transmute(TAZUID,
p_car,
p_transit,
p_walk),
by = "TAZUID")
```
```{r income-quintiles, include=FALSE}
# Data preparation
## Calculate quintiles of median household income in Hamilton:
mhi_q <- data_da_2016 %>%
dplyr::filter(`Region Name` == "Hamilton") %>%
pull(`v_CA16_2397: Median total income of households in 2015 ($)`) %>%
quantile(c(0, 0.2, 0.4, 0.6, 0.8, 1),
na.rm = TRUE)
```
```{r label-income-quintiles, include=FALSE}
# Data preparation
## Label the DAs according to income quintiles
data_da_2016 <- data_da_2016 %>%
rename(Median_household_income = `v_CA16_2397: Median total income of households in 2015 ($)`) %>%
mutate(income_quintile = case_when(Median_household_income < mhi_q[2] ~ "Bottom 20%",
Median_household_income >= mhi_q[2] & Median_household_income < mhi_q[3] ~ "Fourth 20%",
Median_household_income >= mhi_q[3] & Median_household_income < mhi_q[4] ~ "Third 20%",
Median_household_income >= mhi_q[4] & Median_household_income < mhi_q[5] ~ "Second 20%",
Median_household_income >= mhi_q[5] ~ "Top 20%"),
income_quintile = factor(income_quintile,
levels = c("Top 20%",
"Second 20%",
"Third 20%",
"Fourth 20%",
"Bottom 20%"),
ordered = TRUE))
```
```{r minimum-travel-time-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Retrieve the minimum travel time from a point to a pharmacy by each mode for people aged 55 to 69:
min_ttm_car <- ttm_car %>%
dplyr::filter(Type == "Pilot") %>%
group_by(UID) %>%
summarize(travel_time = min(travel_time),
Population = first(Population_55to69),
Urban_type = first(Urban_type),
DAUID = first(DAUID),
TAZUID = first(TAZUID),
p_car = first(p_car),
p_transit = first(p_transit),
p_walk = first(p_walk),
.groups = "drop")
min_ttm_transit <- ttm_transit %>%
dplyr::filter(Type == "Pilot") %>%
group_by(UID) %>%
summarize(travel_time = min(travel_time),
Population = first(Population_55to69),
Urban_type = first(Urban_type),
DAUID = first(DAUID),
TAZUID = first(TAZUID),
p_car = first(p_car),
p_transit = first(p_transit),
p_walk = first(p_walk),
.groups = "drop")
min_ttm_walk <- ttm_walk %>%
dplyr::filter(Type == "Pilot") %>%
group_by(UID) %>%
summarize(travel_time = min(travel_time),
Population = first(Population_55to69),
Urban_type = first(Urban_type),
DAUID = first(DAUID),
TAZUID = first(TAZUID),
p_car = first(p_car),
p_transit = first(p_transit),
p_walk = first(p_walk),
.groups = "drop")
```
```{r weighted-travel-time-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Calculate weighted travel time:
min_ttm_car <- min_ttm_car %>%
mutate(weighted_travel_time = travel_time * p_car)
min_ttm_transit <- min_ttm_transit %>%
mutate(weighted_travel_time = travel_time * p_transit)
min_ttm_walk <- min_ttm_walk %>%
mutate(weighted_travel_time = travel_time * p_walk)
```
```{r bind-travel-time-tables-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Bind the three tables:
min_ttm <- rbind(min_ttm_car,
min_ttm_transit,
min_ttm_walk)
```
```{r weighted-travel-time-by-mode-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Bind the three tables and label them by mode:
min_ttm_mode_baseline <- rbind(data.frame(min_ttm_car, Mode = "Car"),
data.frame(min_ttm_transit, Mode = "Transit"),
data.frame(min_ttm_walk, Mode = "Walking"))
```
```{r aggregate-weighted-travel-times-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Aggregate weighted travel times by mode:
min_ttm <- min_ttm %>%
group_by(UID) %>%
summarize(DAUID = first(DAUID),
TAZUID = first(TAZUID),
Population = first(Population),
Urban_type = first(Urban_type),
weighted_travel_time = sum(weighted_travel_time))
```
```{r calculate-person-hours-travel-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Calculate person-hours of travel:
min_ttm <- min_ttm %>%
mutate(weighted_person_hours = Population * weighted_travel_time/60)
```
```{r summarize-results-by-taz-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Summarize by TAZ and join geometry:
min_ttm_taz <- min_ttm %>%
group_by(TAZUID) %>%
summarize(weighted_travel_time = mean(weighted_travel_time),
weighted_person_hours = sum(weighted_person_hours)) %>%
left_join(modes %>%
dplyr::select(TAZUID),
by = "TAZUID") %>%
st_as_sf()
```
```{r weighted-travel-time-map-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Map weighted travel time:
ttm_map_baseline <- ggplot() +
geom_sf(data = min_ttm_taz,
aes(fill = weighted_travel_time),
color = NA) +
scale_fill_distiller(name = "Expected travel time (min)",
palette = "OrRd",
direction = 1) +
geom_sf(data = urban_types,
aes(color = Type),
fill = NA) +
scale_color_manual(name = "",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
```
```{r person-hours-traveled-map-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Map weighted person-hours of travel:
pht_map_baseline <- ggplot() +
geom_sf(data = min_ttm_taz,
aes(fill = weighted_person_hours),
color = NA) +
scale_fill_distiller(name = "Person-hours of travel",
palette = "OrRd",
direction = 1) +
geom_sf(data = urban_types,
aes(color = Type),
fill = NA) +
scale_color_manual(name = "",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
```
```{r join-income-information-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Join median household information to table:
min_ttm <- min_ttm %>%
left_join(data_da_2016 %>%
st_drop_geometry() %>%
dplyr::transmute(DAUID = GeoUID,
income_quintile),
by = "DAUID")
```
```{r plot-distribution-travel-time-by-income-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Distribution of weighted travel time by income:
ttm_income_baseline <- ggplot(data = min_ttm,
aes(x = weighted_travel_time,
color= income_quintile)) +
geom_density(size = 0.5, adjust = 2.5) +
labs(x = "Travel time (in minutes; weighted by mode)") +
scale_color_manual(values = c("Top 20%" = "blue",
"Second 20%" = "steelblue1",
"Third 20%" = "gray40",
"Fourth 20%" = "tomato",
"Bottom 20%" = "red")) +
theme_minimal() +
theme(text = element_text(size = 7),
legend.text = element_text(size = 7))
```
```{r plot-distribution-travel-time-by-region-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Distribution of weighted travel time by region:
ttm_region_baseline <- ggplot(data = min_ttm %>%
drop_na(Urban_type),
aes(x = weighted_travel_time,
color= Urban_type)) +
geom_density(size = 0.5, adjust = 3) +
labs(x = "Travel time (in minutes; weighted by mode)") +
scale_color_manual(name = "",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
theme_minimal() +
theme(text = element_text(size = 7),
legend.text = element_text(size = 7))
```
```{r total-weighted-person-hours-by-group-baseline, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Total weighted person-hours by income:
person_hours_income_baseline <- min_ttm %>%
group_by(income_quintile) %>%
summarize(total_weighted_person_hours = sum(weighted_person_hours),
total_population = sum(Population),
.groups = "drop") %>%
mutate(ratio = total_weighted_person_hours/total_population) %>%
rename(group = income_quintile)
## Total weighted person-hours by region:
person_hours_region_baseline <- min_ttm %>%
group_by(Urban_type) %>%
summarize(total_weighted_person_hours = sum(weighted_person_hours),
total_population = sum(Population),
.groups = "drop") %>%
drop_na() %>%
mutate(ratio = total_weighted_person_hours/total_population) %>%
rename(group = Urban_type)
person_hours_baseline <- rbind(person_hours_income_baseline,
person_hours_region_baseline)
```
```{r minimum-travel-time, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Retrieve the minimum travel time from a point to a pharmacy by each mode for people aged 55 to 69:
min_ttm_car <- ttm_car %>%
#dplyr::filter(Type == "Pilot") %>%
group_by(UID) %>%
summarize(travel_time = min(travel_time),
Population = first(Population_55to69),
Urban_type = first(Urban_type),
DAUID = first(DAUID),
TAZUID = first(TAZUID),
p_car = first(p_car),
p_transit = first(p_transit),
p_walk = first(p_walk),
.groups = "drop")
min_ttm_transit <- ttm_transit %>%
#dplyr::filter(Type == "Pilot") %>%
group_by(UID) %>%
summarize(travel_time = min(travel_time),
Population = first(Population_55to69),
Urban_type = first(Urban_type),
DAUID = first(DAUID),
TAZUID = first(TAZUID),
p_car = first(p_car),
p_transit = first(p_transit),
p_walk = first(p_walk),
.groups = "drop")
min_ttm_walk <- ttm_walk %>%
#dplyr::filter(Type == "Pilot") %>%
group_by(UID) %>%
summarize(travel_time = min(travel_time),
Population = first(Population_55to69),
Urban_type = first(Urban_type),
DAUID = first(DAUID),
TAZUID = first(TAZUID),
p_car = first(p_car),
p_transit = first(p_transit),
p_walk = first(p_walk),
.groups = "drop")
```
```{r weighted-travel-time, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Calculate weighted travel time:
min_ttm_car <- min_ttm_car %>%
mutate(weighted_travel_time = travel_time * p_car)
min_ttm_transit <- min_ttm_transit %>%
mutate(weighted_travel_time = travel_time * p_transit)
min_ttm_walk <- min_ttm_walk %>%
mutate(weighted_travel_time = travel_time * p_walk)
```
```{r bind-travel-time-tables, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Bind the three tables:
min_ttm <- rbind(min_ttm_car,
min_ttm_transit,
min_ttm_walk)
```
```{r weighted-travel-time-by-mode, include=FALSE}
# Baseline analysis (PILOT LOCATIONS ONLY)
## Bind the three tables and label them by mode:
min_ttm_mode <- rbind(data.frame(min_ttm_car, Mode = "Car"),
data.frame(min_ttm_transit, Mode = "Transit"),
data.frame(min_ttm_walk, Mode = "Walking"))
```
```{r aggregate-weighted-travel-times, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Aggregate weighted travel times by mode:
min_ttm <- min_ttm %>%
group_by(UID) %>%
summarize(DAUID = first(DAUID),
TAZUID = first(TAZUID),
Population = first(Population),
Urban_type = first(Urban_type),
weighted_travel_time = sum(weighted_travel_time))
```
```{r calculate-person-hours-travel, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Calculate person-hours of travel:
min_ttm <- min_ttm %>%
mutate(weighted_person_hours = Population * weighted_travel_time/60)
```
```{r summarize-results-by-taz, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Summarize by TAZ and join geometry:
min_ttm_taz <- min_ttm %>%
group_by(TAZUID) %>%
summarize(weighted_travel_time = mean(weighted_travel_time),
weighted_person_hours = sum(weighted_person_hours)) %>%
left_join(modes %>%
dplyr::select(TAZUID),
by = "TAZUID") %>%
st_as_sf()
```
```{r weighted-travel-time-map, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Map weighted travel time. This is the average of the weighted travel time per TAZ:
ttm_map <- ggplot() +
geom_sf(data = min_ttm_taz,
aes(fill = weighted_travel_time),
color = NA) +
geom_sf(data = hamilton_cma,
fill = NA) +
scale_fill_distiller(palette = "OrRd",
direction = 1)
```
```{r total-person-hours-map, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Map weighted person-hours of travel. This is the total person-hours traveled per TAZ:
pht_map <- ggplot() +
geom_sf(data = min_ttm_taz,
aes(fill = weighted_person_hours),
color = NA) +
geom_sf(data = hamilton_cma,
fill = NA) +
scale_fill_distiller(palette = "OrRd",
direction = 1)
```
```{r join-income-information, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Join median household information to table:
min_ttm <- min_ttm %>%
left_join(data_da_2016 %>%
st_drop_geometry() %>%
dplyr::transmute(DAUID = GeoUID,
income_quintile),
by = "DAUID")
```
```{r plot-distribution-travel-time-by-income, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Distribution of weighted travel time by income:
ttm_income <- ggplot(data = min_ttm,
aes(x = weighted_travel_time,
color= income_quintile)) +
geom_density(size = 0.5, adjust = 2.5) +
labs(x = "Travel time (in minutes; weighted by mode)") +
scale_color_manual(name = "Income quintile",
values = c("Top 20%" = "blue",
"Second 20%" = "steelblue1",
"Third 20%" = "gray40",
"Fourth 20%" = "tomato",
"Bottom 20%" = "red")) +
theme_minimal() +
theme(text = element_text(size = 7),
legend.text = element_text(size = 7))
```
```{r plot-distribution-travel-time-by-region, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Distribution of weighted travel time by region:
ttm_region <- ggplot(data = min_ttm %>%
drop_na(Urban_type),
aes(x = weighted_travel_time,
color= Urban_type)) +
geom_density(size = 0.5, adjust = 3) +
labs(x = "Travel time (in minutes; weighted by mode)") +
scale_color_manual(name = "Region",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
theme_minimal() +
theme(text = element_text(size = 7),
legend.text = element_text(size = 7))
```
```{r total-weighted-person-hours-by-group, include=FALSE}
# Scenario analysis (PILOT AND CANDIDATE LOCATIONS)
## Total weighted person-hours by income:
person_hours_income <- min_ttm %>%
group_by(income_quintile) %>%
summarize(total_weighted_person_hours = sum(weighted_person_hours),
total_population = sum(Population),
.groups = "drop") %>%
mutate(ratio = total_weighted_person_hours/total_population) %>%
rename(group = income_quintile)
## Total weighted person-hours by region:
person_hours_region <- min_ttm %>%
group_by(Urban_type) %>%
summarize(total_weighted_person_hours = sum(weighted_person_hours),
total_population = sum(Population),
.groups = "drop") %>%
drop_na() %>%
mutate(ratio = total_weighted_person_hours/total_population) %>%
rename(group = Urban_type)
person_hours <- rbind(person_hours_income,
person_hours_region)
```
```{r table-comparison, echo=FALSE}
table_comparison <- cbind(person_hours_baseline %>%
dplyr::select(group, total_population, total_weighted_person_hours, ratio),
person_hours %>%
dplyr::select(total_weighted_person_hours, ratio))
colnames(table_comparison) <- c("group", "total_population", "total_weighted_person_hours_baseline", "ratio_baseline",
"total_weighted_person_hours", "ratio")
table_comparison <- table_comparison %>%
mutate(total_weighted_person_hours_baseline = round(total_weighted_person_hours_baseline, 2),
ratio_baseline = set_units(ratio_baseline, h) %>%
set_units(min) %>%
drop_units(),
ratio_baseline = round(ratio_baseline, 2),
total_weighted_person_hours = round(total_weighted_person_hours, 2),
ratio = set_units(ratio, h) %>%
set_units(min) %>%
drop_units(),
ratio = round(ratio, 2))
```
```{r comparison-travel-time-by-mode, echo=FALSE}
# Comparison of weighted travel times by mode between pilot and scenario
comparison_ttm_mode <- cbind(min_ttm_mode_baseline %>%
group_by(Mode) %>%
summarize(pht_mode_baseline = sum(Population * weighted_travel_time/60),
.groups = "drop"),
min_ttm_mode %>%
group_by(Mode) %>%
summarize(pht_mode = sum(Population * weighted_travel_time/60),
.groups = "drop") %>%
select(pht_mode)) %>%
mutate(diff = paste0(round((pht_mode - pht_mode_baseline)/pht_mode_baseline * 100, 2), "%", sep = ""))
```
Questions
==========================
Along with the provision of health care facilities to treat severe cases of COVID-19 [e.g., @Ghorbanzadeh2021spatial; @Pereira2021geographic], another front in the fight against the pandemic is the rolling out of vaccination programs. The Government of Ontario, in Canada, implemented a pilot program to offer vaccines in pharmacies for people 60 years and older in early 2021. In the first incarnation of this program, the province approved 325 pharmacies in Toronto, Windsor-Essex, and Kingston (the latter including the region of Frontenac-Lennox and Addington). The City of Hamilton, the third most populous urban center in the province, operated dedicated vaccination centers for people aged 70+ and mobile pop-up clinics for people aged 75+; however, it did not have any approved pharmacies under the pilot for other populations until April 1st 2021, with the announcement of 20 pharmacies in the city \footnote{\url{https://www.cbc.ca/news/canada/hamilton/astrazeneca-vaccine-hamilton-1.5972704}}. At the same time that the expansion of the pilot was announced, the province extended eligibility for this program to people 55 years and older.
Critics were swift to point out that the list of pharmacies approved for Hamilton by the province were mostly located in lower density parts of the city that are not well serviced by transit and are difficult to reach by foot\footnote{See inter alia: \url{https://twitter.com/RyanMcGreal/status/1378027149790224386?s=20} and \url{https://twitter.com/NrinderWard3/status/1378679195514060801?s=20}.}. Indeed, as seen in Figure \ref{fig:pharmacies-and-regions}, a vast majority of the pharmacies are in suburban Hamilton. Whether this is an issue is less clear-cut when we consider that Hamilton's older population skews suburban (see Figure \ref{fig:population-map}). Given the target demographic for the program, it is possible that suburban sites could be convenient for mature adults and the young old: the population aged 55 to 69 in Hamilton is approximately `r prettyNum(round((table_comparison[7,2]/1000), 2) * 1000, big.mark = ",")` suburban, `r prettyNum(round((table_comparison[8,2]/1000), 2) * 1000, big.mark = ",")` urban, and only `r prettyNum(round((table_comparison[6,2]/1000), 2) * 1000, big.mark = ",")` rural. Nevertheless, the selection of sites by the province raised some important questions\footnote{The decision-making process to select these sites appears to have been opaque, and the Mayor of the city was caught flat footed by the announcement; see: \url{https://twitter.com/FredEisenberger/status/1378350123114242053?s=20}}. As @Yu2021sustained note, good geographical coverage is a key element for a successful vaccination campaign; at the same time, siting vaccinations sites in car-oriented locations may lead to inequities in access by requiring people who do not own cars or who typically travel by other modes (mostly lower income urban residents) to spend more of their time reaching an approved pharmacy.
In this research, we investigate the accessibility implications of the sites selected for the pilot vaccination program. Concretely, we ask:
- What is the estimated travel time needed to reach the nearest approved pharmacy, assuming that every person requires a vaccine?
- What is the distribution of travel times across the population of the city?
- How does the cost of time needed for travel and its distribution change with the addition of candidate vaccination sites in urban Hamilton?
We concentrate on the 55 to 69 year old population segment because the older 70+ group have access to other dedicated facilities besides those in the provincial pharmacy pilot (including pop-up clinics for people 75+).
```{r pharmacies-map, echo=FALSE, fig.height=4, fig.align="center", fig.cap="\\label{fig:pharmacies-and-regions}Regions with the City of Hamilton; the location of pharmacies in pilot is shown (black triangles) along with urban locations for scenario analysis (white circles)."}
#map_pharmacies <-
ggplot() +
geom_sf(data = urban_types,
aes(fill = Type),
color = "lightgray") +
geom_sf(data = pharmacy_locations,
aes(shape = Type,
color = Type),
size = 2.5,
show.legend = FALSE) +
scale_color_manual(values = c("Candidate" = "white",
"Pilot" = "black")) +
scale_fill_manual(values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
guides(fill = guide_legend(title = "")) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
```
```{r save-pharmacies-map-1, include=FALSE, eval=FALSE}
ggplot() +
geom_sf(data = urban_types,
aes(fill = Type),
color = "lightgray") +
geom_sf(data = pharmacy_locations %>%
filter(Type == "Pilot"),
aes(shape = Type,
color = Type),
size = 2.5,
show.legend = FALSE) +
scale_shape_manual(values = c("Candidate" = 16,
"Pilot" = 17)) +
scale_color_manual(values = c("Candidate" = "white",
"Pilot" = "black")) +
scale_fill_manual(values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
guides(fill = guide_legend(title = "")) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
ggsave("images/pharmacies-map-1.jpeg")
```
```{r save-pharmacies-map-2, include=FALSE, eval=FALSE}
ggplot() +
geom_sf(data = urban_types,
aes(fill = Type),
color = "lightgray") +
geom_sf(data = pharmacy_locations,
aes(shape = Type,
color = Type),
size = 2.5,
show.legend = FALSE) +
scale_shape_manual(values = c("Candidate" = 16,
"Pilot" = 17)) +
scale_color_manual(values = c("Candidate" = "white",
"Pilot" = "black")) +
scale_fill_manual(values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
guides(fill = guide_legend(title = "")) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
ggsave("images/pharmacies-map-2.jpeg")
```
```{r population-map, echo=FALSE, warning=FALSE, fig.height=8, fig.align="center", fig.cap="\\label{fig:population-map}Distribution of population aged 55+ in the City of Hamilton."}
ggplot() +
geom_sf(data = data_da_2016 %>%
filter(`Region Name` == "Hamilton") %>%
dplyr::select(Population_55to69, Population_70plus) %>%
pivot_longer(cols = -geometry, names_to = "Age", values_to = "Population") %>%
mutate(Age = factor(Age,
levels = c("Population_55to69",
"Population_70plus"),
labels = c("Age: 55 to 69",
"Age: 70+"),
ordered = TRUE)) %>%
st_as_sf(),
aes(fill = Population),
color = NA) +
geom_sf(data = urban_types,
aes(color = Type),
fill = NA) +
scale_fill_distiller(name = "Population",
breaks = c(20, 50, 150, 400),
palette = "OrRd",
trans = "log",
direction = 1) +
scale_color_manual(name = "",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
facet_wrap(~ Age, nrow = 2) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
```
```{r save-population-map, include=FALSE, fig.height=8, dpi=300, eval=FALSE}
ggplot() +
geom_sf(data = data_da_2016 %>%
filter(`Region Name` == "Hamilton") %>%
dplyr::select(Population_55to69, Population_70plus) %>%
pivot_longer(cols = -geometry, names_to = "Age", values_to = "Population") %>%
mutate(Age = factor(Age,
levels = c("Population_55to69",
"Population_70plus"),
labels = c("Age: 55 to 69",
"Age: 70+"),
ordered = TRUE)) %>%
st_as_sf(),
aes(fill = Population),
color = NA) +
geom_sf(data = urban_types,
aes(color = Type),
fill = NA) +
scale_fill_distiller(name = "Population",
breaks = c(20, 50, 150, 400),
palette = "OrRd",
trans = "log",
direction = 1) +
scale_color_manual(name = "",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
facet_wrap(~ Age, nrow = 2) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
ggsave("images/population-map.jpeg")
ggplot() +
geom_sf(data = data_da_2016 %>%
filter(`Region Name` == "Hamilton"),
aes(fill = Population_55to69),
color = NA) +
geom_sf(data = urban_types,
aes(color = Type),
fill = NA) +
scale_fill_distiller(name = "Population aged 55 to 69",
breaks = c(20, 50, 150, 400),
palette = "OrRd",
trans = "log",
direction = 1) +
scale_color_manual(name = "",
values = c("Urban" = "firebrick2",
"Suburban" = "cornflowerblue",
"Rural" = "forestgreen")) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.text = element_text(size = 7),
legend.position = "bottom",
legend.text = element_text(size = 8))
ggsave("images/population-55-to-69-map.jpeg")
```
Methods
============
We use data from the following sources.
- Urban, suburban, and rural boundary definitions from the City of Hamilton\footnote{\url{https://open.hamilton.ca/}}
- Population and median total household income for 2016 by Dissemination Area (DA) boundary using the `cancensus` package [@vonBergmann2021cancensus]
- Modal split by age for traffic analysis zones (TAZ) from the 2016 Transportation Tomorrow Survey (TTS)\footnote{\url{http://dmg.utoronto.ca/}}
- Locations of pilot pharmacies from public records
- Locations of three additional major chain pharmacies for scenario testing
- Residential units by land parcel
Using the population aged 55 to 69 y.o. we first calculate the average number of people per dwelling and assign them proportionally to the dwellings by parcel. Second, median household incomes and modal splits across walking, transit, and car are joined to the parcels. Our data are from 2016 (the most recent available), but we assume they are largely representative of spatial, mobility, and demographic trends in the city. In the absence of travel behavior information during the pandemic we suggest this is an inevitable limitation of the analysis. Third, we use the `r5r` [@Pereira2021r5r] package to calculate the travel time from each parcel to all pharmacies by three modes using a cutoff value of 180 min and a maximum walking distance of 10,000 m. These thresholds are chosen to maximize the coverage of the travel time tables, but the analysis, as explained next, is based on travel to the nearest approved pharmacy. Once we obtained travel time tables with population, proportion of trips by mode, and income information, we calculated the expected travel time $ett$ from each parcel $i$ to a pharmacy $j$ as follows:
$$
ett_i = p^c_i \min(tt^c_{ij}) + p^t_i \min(tt^t_{ij}) + p^w_i \min(tt^w_{ij})
$$
\noindent where $p^k_i$ is the proportion of trips by mode $k$ in the TAZ of parcel $i$, and $tt^k_{ij}$ is the vector of travel times from parcel $i$ to the pharmacies. The expected travel time is thus the weighted sum of travel times to the _nearest_ pharmacy, with the weights given by the expected modal split in the TAZ.
The expected travel time $i$ was multiplied by the assigned population in parcel $i$ to obtain a measure of person-hours of travel ($PHT$) that gives a cumulative cost (in travel time) for a population group. This is as follows:
$$
PHT_i = P_i\cdot ett_i
$$
Please note that this paper is a reproducible research document [see @Brunsdon2020opening] conducted using open source tools for transportation analysis [@Lovelace2021open]. The code and data necessary to reproduce the analysis are available in a public repository\footnote{\url{https://github.com/paezha/Accessibility-Pharmacies-Hamilton-Vaccines}}.
Findings
===================
The top panel of Figure \ref{fig:maps-baseline} shows the average multimodal travel times (weighted by modal shares) by TAZ in Hamilton. It is apparent that travel times tend to be lower in much of suburban Hamilton and higher in the urban core and some rural parts of the city, particularly to the west. This is unsurprising, given the higher probability of travel by car and the predominantly suburban character of the vaccination sites. However, even accounting for the distribution of population, this leads to large disparities in the number of person-hours of travel across the city, with a concentration of the burden of travel in the urban core and the rural west (see bottom panel of Figure \ref{fig:maps-baseline}).