Last updated: 2022-08-25

Checks: 6 1

Knit directory: Vaccination_COVID/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210126) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version a6e8ed9. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/figure/
    Ignored:    code/.DS_Store

Untracked files:
    Untracked:  analysis/haiduong_measles.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE, out.width = "100%")

library(data.table)
library(dplyr)
Warning: package 'dplyr' was built under R version 4.1.2

Attaching package: 'dplyr'
The following objects are masked from 'package:data.table':

    between, first, last
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(tidyr)
Warning: package 'tidyr' was built under R version 4.1.2
library(lubridate)

Attaching package: 'lubridate'
The following objects are masked from 'package:data.table':

    hour, isoweek, mday, minute, month, quarter, second, wday, week,
    yday, year
The following objects are masked from 'package:base':

    date, intersect, setdiff, union
library(ggplot2)
library(gtsummary)
Warning: package 'gtsummary' was built under R version 4.1.2
library(ggsci)
library(plotly)

Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':

    last_plot
The following object is masked from 'package:stats':

    filter
The following object is masked from 'package:graphics':

    layout
datap <- file.path("~", "Downloads", "updated_dataset")

covidvc <- readRDS(file.path(datap, "Combined_VAC_COVID19_2022-02-17.rds"))
measle_all <- readRDS(file.path(datap, "measles_haiduong.rds"))
measle_all <- data.table(measle_all)

hepb <- readRDS(file.path(datap, "hepb_haiduong.rds"))
hepb <- data.table(hepb)
hepb <- hepb[which(hepb$shot == 1),]

time_step <- "month"
measle_all$vacym <- floor_date(measle_all$vacdate, time_step)
measle_all$vacname2 <- factor(measle_all$vacname2, levels = c("Measles", "MR", "MMR"))

Measles and COVID-19 vaccination per month

* High peak of MR shots in Nov 2019 * No disruption in Apr 2020 * Disruptions in Aug 2020 and Feb 2021

Vaccination campaign in Nov 2019

An MR vaccination campaign is triggered during this time in Hai Duong, focusing on children 1-5 year-old # No disruption in Apr 2020 but in Aug 2020 and Feb 2021

The monthly vaccination date at public clinics is usually at the end of the month. In Mar 2020: right before lockdown they vaccinate children and right after lockdown they came back to vaccinate children

Hai Duong had a Hai Duong city-wide lockdown from 14/8-28/8, this time looks like they only organised the vaccination day in Sep so all children scheduled in Aug miss the shot

Zoom in 2021

Hai Duong had a province-wide lockdown from 28/1/2021 - 15/2 (Directive 15), 16/2 - 2/3 (Directive 16), 3/3 - 17/3 (Directive 15), 18/3 - 31/3 (Directive 19)

Directive 16 > 15 > 19

Public vs private

First let decide how a shot is public or private


hospital    other  private   public  unknown 
     389     2171    36149   353342    12616 

Extract children who get 2 shots

Some received the same vaccine in the same day, filter them out and continue

Some received 3 shots, filtered them out.

Change dataset from long to wide format

Aggregate them by month

Line plot

# A tibble: 6 × 10
    pid denom low_ci high_ci vyear_1st vmonth_1st shot1   shot2  pct2 vacdate_…¹
  <dbl> <dbl>  <dbl>   <dbl>     <dbl>      <dbl> <fct>   <chr> <dbl> <date>    
1    11    26   23.4    63.1      2020          1 private priv…  42.3 2020-01-01
2    51   106   38.3    58.0      2020          1 public  priv…  48.1 2020-01-01
3    33    46   56.5    84.0      2020          8 private priv…  71.7 2020-08-01
4    56   132   33.9    51.3      2020          8 public  priv…  42.4 2020-08-01
5    11    17   38.3    85.8      2021          2 private priv…  64.7 2021-02-01
6    32    68   34.8    59.6      2021          2 public  priv…  47.1 2021-02-01
# … with abbreviated variable name ¹​vacdate_1st
# A tibble: 18 × 10
     pid denom low_ci high_ci vyear_1st vmonth_1st shot1  shot2  pct2 vacdate_…¹
   <dbl> <dbl>  <dbl>   <dbl>     <dbl>      <dbl> <fct>  <chr> <dbl> <date>    
 1    31    62   37.0    63.0      2021          3 priva… priv…  50   2021-03-01
 2   445  2897   14.1    16.7      2021          3 public priv…  15.4 2021-03-01
 3    25    54   32.6    60.4      2021          4 priva… priv…  46.3 2021-04-01
 4   304  1711   16.0    19.7      2021          4 public priv…  17.8 2021-04-01
 5    18    50   22.9    50.8      2021          5 priva… priv…  36   2021-05-01
 6   266  1664   14.3    17.8      2021          5 public priv…  16.0 2021-05-01
 7    29    44   50.1    79.5      2021          6 priva… priv…  65.9 2021-06-01
 8   354  2065   15.5    18.8      2021          6 public priv…  17.1 2021-06-01
 9    26    48   39.2    68.6      2021          7 priva… priv…  54.2 2021-07-01
10   364  2030   16.3    19.7      2021          7 public priv…  17.9 2021-07-01
11    25    35   53.7    85.4      2021          8 priva… priv…  71.4 2021-08-01
12   372  1697   20.0    24.0      2021          8 public priv…  21.9 2021-08-01
13    11    27   22.4    61.2      2021          9 priva… priv…  40.7 2021-09-01
14   258  1281   18.0    22.4      2021          9 public priv…  20.1 2021-09-01
15    17    28   40.6    78.5      2021         10 priva… priv…  60.7 2021-10-01
16   237   694   30.6    37.8      2021         10 public priv…  34.1 2021-10-01
17    10    14   41.9    91.6      2021         11 priva… priv…  71.4 2021-11-01
18   156   276   50.4    62.5      2021         11 public priv…  56.5 2021-11-01
# … with abbreviated variable name ¹​vacdate_1st

Population level

Children who got 2 shots

tmp <- measle_all[which(measle_all$vacname2 == "MMR"),]
table(tmp$shot)

    1 
49723 
hepb$dob_ym <- floor_date(hepb$dob, time_step)
measle_all$dob_ym <- floor_date(measle_all$dob, time_step)
measle_all$vac_ym <- floor_date(measle_all$vacdate, time_step)

R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotly_4.10.0     ggsci_2.9         gtsummary_1.6.1   ggplot2_3.3.5    
[5] lubridate_1.8.0   tidyr_1.2.0       dplyr_1.0.9       data.table_1.14.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9          assertthat_0.2.1    rprojroot_2.0.3    
 [4] digest_0.6.29       utf8_1.2.2          R6_2.5.1           
 [7] evaluate_0.16       httr_1.4.4          highr_0.9          
[10] pillar_1.8.1        rlang_1.0.4         lazyeval_0.2.2     
[13] rstudioapi_0.13     jquerylib_0.1.4     rmarkdown_2.15     
[16] labeling_0.4.2      stringr_1.4.1       htmlwidgets_1.5.4  
[19] munsell_0.5.0       compiler_4.1.1      httpuv_1.6.5       
[22] xfun_0.32           pkgconfig_2.0.3     htmltools_0.5.3    
[25] tidyselect_1.1.2    tibble_3.1.8        workflowr_1.7.0    
[28] fansi_1.0.3         viridisLite_0.4.0   crayon_1.5.1       
[31] withr_2.5.0         later_1.3.0         grid_4.1.1         
[34] jsonlite_1.8.0      gtable_0.3.0        lifecycle_1.0.1    
[37] DBI_1.1.3           git2r_0.30.1        magrittr_2.0.3     
[40] scales_1.2.1        cli_3.3.0           stringi_1.7.8      
[43] cachem_1.0.6        farver_2.1.0        broom.helpers_1.8.0
[46] fs_1.5.2            promises_1.2.0.1    bslib_0.4.0        
[49] ellipsis_0.3.2      generics_0.1.3      vctrs_0.4.1        
[52] RColorBrewer_1.1-2  tools_4.1.1         glue_1.6.2         
[55] purrr_0.3.4         crosstalk_1.2.0     fastmap_1.1.0      
[58] yaml_2.3.5          colorspace_2.0-3    gt_0.6.0           
[61] knitr_1.39          sass_0.4.2