Last updated: 2022-10-02
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 file has unstaged changes. 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 9de46e5. 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: code/.DS_Store
Unstaged changes:
Modified: 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.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/haiduong_measles.Rmd
) and
HTML (docs/haiduong_measles.html
) files. If you’ve
configured a remote Git repository (see ?wflow_git_remote
),
click on the hyperlinks in the table below to view the files as they
were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 9de46e5 | thinhong | 2022-09-29 | optimise code for coverage: create a big table then filter to plot |
Rmd | 11694c5 | thinhong | 2022-08-30 | change x axis labels to 3 months |
html | 11694c5 | thinhong | 2022-08-30 | change x axis labels to 3 months |
Rmd | 74070b7 | thinhong | 2022-08-30 | update Hai Duong vaccine coverage for 2017, 2018, 2 doses; clarify axis titles |
html | 74070b7 | thinhong | 2022-08-30 | update Hai Duong vaccine coverage for 2017, 2018, 2 doses; clarify axis titles |
Rmd | 3b8e1fa | thinhong | 2022-08-25 | add coverage for mr and mmr |
html | 3b8e1fa | thinhong | 2022-08-25 | add coverage for mr and mmr |
Rmd | 8629620 | thinhong | 2022-08-25 | add vaccine coverage and confidence interval |
html | 8629620 | thinhong | 2022-08-25 | add vaccine coverage and confidence interval |
knitr::opts_chunk$set(echo = F, warning = F, message = F, out.width = "100%")
library(data.table)
library(dplyr)
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)
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)
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
pv_name <- "Hai Duong"
pv_filename <- "haiduong"
datap <- file.path("~", "Downloads", "updated_dataset")
dtoutp <- file.path("~", "Dropbox", "github", "vaccine_registry_data", pv_filename)
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"))
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)
Version | Author | Date |
---|---|---|
74070b7 | thinhong | 2022-08-30 |
An MR vaccination campaign is triggered during this time in Hai
Duong, focusing on children 1-5 year-old
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
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
R version 4.2.1 (2022-06-23)
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.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/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.6
[5] lubridate_1.8.0 tidyr_1.2.1 dplyr_1.0.10 data.table_1.14.2
loaded via a namespace (and not attached):
[1] tidyselect_1.1.2 xfun_0.33 bslib_0.4.0
[4] purrr_0.3.4 colorspace_2.0-3 vctrs_0.4.2
[7] generics_0.1.3 viridisLite_0.4.1 htmltools_0.5.3
[10] yaml_2.3.5 utf8_1.2.2 rlang_1.0.6
[13] jquerylib_0.1.4 later_1.3.0 pillar_1.8.1
[16] glue_1.6.2 withr_2.5.0 RColorBrewer_1.1-3
[19] lifecycle_1.0.2 stringr_1.4.1 munsell_0.5.0
[22] gtable_0.3.1 workflowr_1.7.0 htmlwidgets_1.5.4
[25] evaluate_0.16 labeling_0.4.2 knitr_1.40
[28] fastmap_1.1.0 crosstalk_1.2.0 httpuv_1.6.6
[31] fansi_1.0.3 highr_0.9 Rcpp_1.0.9
[34] promises_1.2.0.1 scales_1.2.1 cachem_1.0.6
[37] jsonlite_1.8.0 farver_2.1.1 fs_1.5.2
[40] digest_0.6.29 stringi_1.7.8 rprojroot_2.0.3
[43] grid_4.2.1 cli_3.4.1 tools_4.2.1
[46] magrittr_2.0.3 sass_0.4.2 lazyeval_0.2.2
[49] tibble_3.1.8 whisker_0.4 pkgconfig_2.0.3
[52] ellipsis_0.3.2 broom.helpers_1.9.0 httr_1.4.4
[55] gt_0.7.0 rmarkdown_2.16 rstudioapi_0.14
[58] R6_2.5.1 git2r_0.30.1 compiler_4.2.1