From 199a3a7eb417588275125d21a747cf672e264319 Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Sun, 5 Feb 2023 13:13:27 +0000 Subject: [PATCH 1/8] add gtsummary min version to description --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a9825a43..adf9cd9b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -54,7 +54,7 @@ Imports: ggalluvial, ggplot2 (>= 3.0.0), ggspatial, - gtsummary, + gtsummary (>= 1.7.0), glue, here, janitor, From 40d67029379e7dab93552b46173bb1e1fd888b35 Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Sun, 5 Feb 2023 13:13:45 +0000 Subject: [PATCH 2/8] add_ci for mortality --- .../templates/mortality/skeleton/skeleton.Rmd | 63 +++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd index f45b88a8..64c34cd6 100644 --- a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd @@ -1649,13 +1649,13 @@ Note the possibility of negative confidence intervals if there are low counts ## weighted counts and proportion of dead death_props <- survey_design %>% select(died) %>% - tbl_svysummary() %>% + ## note add_ci() does not allow logical variables + ## type "categorical" changes to a character variable + tbl_svysummary(type = died ~ "categorical") %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1678,10 +1678,9 @@ CMR <- survey_design %>% During the recall period the weighted number and proportion of deaths in the -population was `r inline_text(death_props, variable = "died", column = "stat_0")`, +population was `r inline_text(death_props, variable = "died", column = "stat_0", level = "TRUE")`, with a weighted confidence interval of -`r #inline_text(death_props, variable = "died", column = "add_stat_1")`, and a -design effect of `r #inline_text(death_props, variable = "died", column = "add_stat_2")`. +`r inline_text(death_props, variable = "died", column = "ci_stat_0", level = "TRUE")`. This is a crude mortality rate of `r CMR` deaths per 10000 person-days. @@ -1705,13 +1704,12 @@ Note the possibility of negative confidence intervals if there are low counts ## weighted counts and proportion of dead death_props_strat <- survey_design %>% select(died, health_district) %>% - tbl_svysummary(by = health_district) %>% + tbl_svysummary(type = died ~ "categorical", + by = health_district) %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1737,16 +1735,14 @@ CMR_strat <- survey_design %>% ``` -In District A the weighted number of deaths was -`r inline_text(death_props_strat, variable = "died", column = "stat_1")`, -which gives a weighted proportion of -`r #death_props_strat %>% pull("district_a ci")`, and a design effect of -`r #death_props_strat %>% pull("district_a deff") %>% round(digits = 3)`. -In comparison, the weighted number of deaths in District B was -`r inline_text(death_props_strat, variable = "died", column = "stat_2")`, -the weighted proportion was -`r #death_props_strat %>% pull("district_b ci")` and the design effect was -`r #death_props_strat %>% pull("district_b deff") %>% round(digits = 3)`. +In District A the weighted number and proportion of deaths was +`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "stat_1")`, +with a weighted confidence interval of +`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "ci_stat_1")`. +In comparison, the weighted number and proportion of deaths in District B was +`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "stat_2")`, +the weighted confidence interval was +`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "ci_stat_2")`. The crude mortality rate in District A was `r CMR_strat %>% filter(health_district == "district_a") %>% pull(Mortality)` deaths per 10000 person-days and in District B was @@ -1861,8 +1857,9 @@ cause_of_death_prop <- survey_design %>% # proportions only among those who died filter(died) %>% select(cause) %>% - tbl_svysummary() + tbl_svysummary() %>% ## add ci + add_ci() ## weighted cause-specific mortality ratios cause_of_death_mort <- survey_design %>% @@ -1893,7 +1890,7 @@ cause_of_death_prop %>% ## modify the column headers modify_header( list( - stat_0 ~ "**Deaths \n N={round(N, digits = 0)}**", + stat_0 ~ "Deaths \n N={round(N, digits = 0)}", mortality ~ "**Mortality per 10,000 person/days (95% CI)**" ) ) %>% @@ -1929,7 +1926,7 @@ survey_design %>% select(cause, health_district) %>% tbl_svysummary(by = health_district) %>% ## add in confidence intervals - + add_ci() %>% ## modify the column headers modify_header( list( @@ -2042,7 +2039,7 @@ survey_design %>% select(cause, age_group) %>% tbl_svysummary(by = age_group) %>% ## add in confidence intervals - + # add_ci() %>% ## modify the column headers modify_spanning_header( all_stat_cols() ~ "**Age group (years)**" @@ -2079,7 +2076,7 @@ survey_design %>% select(cause, sex) %>% tbl_svysummary(by = sex) %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2313,7 +2310,7 @@ survey_design %>% select(cause_illness) %>% tbl_svysummary() %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2344,7 +2341,7 @@ survey_design %>% select(cause_illness, age_group) %>% tbl_svysummary(by = age_group) %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2375,7 +2372,7 @@ survey_design %>% select(cause_illness, sex) %>% tbl_svysummary(by = sex) %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2408,7 +2405,7 @@ survey_design %>% select(no_care_illness) %>% tbl_svysummary() %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2440,7 +2437,7 @@ survey_design %>% select(violent_episodes_number, violence_nature, uniform, place_violence) %>% tbl_svysummary() %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2473,7 +2470,7 @@ survey_design %>% select(fever_now, care_fever) %>% tbl_svysummary() %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format @@ -2504,7 +2501,7 @@ survey_design %>% select(reason_no_care) %>% tbl_svysummary() %>% ## add in confidence intervals - + add_ci() %>% ## make variable names bold bold_labels() %>% # change to flextable format From 02298122c900b3b42694eafd12bdf629992f921d Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Sun, 5 Feb 2023 13:22:15 +0000 Subject: [PATCH 3/8] fix xaxis in alluvial plot mortality --- inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd index 64c34cd6..a02472fc 100644 --- a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd @@ -2211,7 +2211,7 @@ ggplot(data = flow_table, aes(axis1 = startcause, axis2 = endcause, y = n)) + ## define x axis limits and labels - scale_x_discrete(limits = c("Start\ncause", "End\ncause")) + + scale_x_discrete(limits = c("Start\ncause", "End\ncause"), expand = c(0,0)) + ## colour lines by sex geom_alluvium(aes(fill = sex)) + ## fill in the label boxes grey From 5fe66d6a5a4f33130fcc4236ddea0ea3cff2376a Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Sun, 5 Feb 2023 13:27:57 +0000 Subject: [PATCH 4/8] remove kable from options (using flextable) --- inst/rmarkdown/templates/ajs_outbreak/skeleton/skeleton.Rmd | 3 --- .../templates/cholera_outbreak/skeleton/skeleton.Rmd | 3 --- .../templates/measles_outbreak/skeleton/skeleton.Rmd | 3 --- .../templates/meningitis_outbreak/skeleton/skeleton.Rmd | 3 --- inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd | 2 -- inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd | 3 --- .../templates/vaccination_long/skeleton/skeleton.Rmd | 3 --- .../templates/vaccination_short/skeleton/skeleton.Rmd | 5 +---- 8 files changed, 1 insertion(+), 24 deletions(-) diff --git a/inst/rmarkdown/templates/ajs_outbreak/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/ajs_outbreak/skeleton/skeleton.Rmd index 3b53aa0b..6e525c40 100644 --- a/inst/rmarkdown/templates/ajs_outbreak/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/ajs_outbreak/skeleton/skeleton.Rmd @@ -50,9 +50,6 @@ knitr::opts_chunk$set(echo = FALSE, # hide all code chunks in output -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { install.packages("pacman") } diff --git a/inst/rmarkdown/templates/cholera_outbreak/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/cholera_outbreak/skeleton/skeleton.Rmd index 9eac483d..00a8040a 100644 --- a/inst/rmarkdown/templates/cholera_outbreak/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/cholera_outbreak/skeleton/skeleton.Rmd @@ -50,9 +50,6 @@ knitr::opts_chunk$set(echo = FALSE, # hide all code chunks in output -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { install.packages("pacman") } diff --git a/inst/rmarkdown/templates/measles_outbreak/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/measles_outbreak/skeleton/skeleton.Rmd index 92cfb63f..96ec4eef 100644 --- a/inst/rmarkdown/templates/measles_outbreak/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/measles_outbreak/skeleton/skeleton.Rmd @@ -50,9 +50,6 @@ knitr::opts_chunk$set(echo = FALSE, # hide all code chunks in output -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { install.packages("pacman") } diff --git a/inst/rmarkdown/templates/meningitis_outbreak/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/meningitis_outbreak/skeleton/skeleton.Rmd index 3191ead3..97c7d3e2 100644 --- a/inst/rmarkdown/templates/meningitis_outbreak/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/meningitis_outbreak/skeleton/skeleton.Rmd @@ -50,9 +50,6 @@ knitr::opts_chunk$set(echo = FALSE, # hide all code chunks in output -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { install.packages("pacman") } diff --git a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd index a02472fc..e46f85a1 100644 --- a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd @@ -43,8 +43,6 @@ knitr::opts_chunk$set(echo = FALSE, error = TRUE, warning = FALSE, message = FAL fig.width = 6*1.25, fig.height = 6) -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") # Ensures the package "pacman" is installed if (!require("pacman")) { diff --git a/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd index c9b0e793..5af6463e 100644 --- a/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd @@ -79,9 +79,6 @@ For help installing packages, please visit https://r4epis.netlify.com/welcome knitr::opts_chunk$set(echo = FALSE, error = TRUE, fig.width = 6*1.25, fig.height = 6) -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { install.packages("pacman") } diff --git a/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd index cdadf2af..1ea87a00 100644 --- a/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd @@ -46,9 +46,6 @@ For help installing packages, please visit https://r4epis.netlify.com/welcome knitr::opts_chunk$set(echo = FALSE, error = TRUE, fig.width = 6*1.25, fig.height = 6) -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { diff --git a/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd index 698db93d..8fbd5250 100644 --- a/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd @@ -46,9 +46,6 @@ For help installing packages, please visit https://r4epis.netlify.com/welcome knitr::opts_chunk$set(echo = FALSE, error = TRUE, fig.width = 6*1.25, fig.height = 6) -## set default NA to - in output, define figure width/height -options(knitr.kable.NA = "-") - # Ensures the package "pacman" is installed if (!require("pacman")) { @@ -1287,7 +1284,7 @@ left_join(ag, propcount, by = "age_group", suffix = c("", "_pop")) %>% "Source population (%)" = percent_pop, "P-value" = p.value ) %>% - kable(digits = 1) + qflextable() ``` From b1eb19938048cfc7de9566cf19086735e6ccccb7 Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Fri, 10 Feb 2023 11:15:04 +0000 Subject: [PATCH 5/8] update mort add_ci after gtsummary bugfix --- .../templates/mortality/skeleton/skeleton.Rmd | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd index e46f85a1..f3e02729 100644 --- a/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/mortality/skeleton/skeleton.Rmd @@ -1647,8 +1647,6 @@ Note the possibility of negative confidence intervals if there are low counts ## weighted counts and proportion of dead death_props <- survey_design %>% select(died) %>% - ## note add_ci() does not allow logical variables - ## type "categorical" changes to a character variable tbl_svysummary(type = died ~ "categorical") %>% ## add the weighted total add_n() %>% @@ -1702,8 +1700,7 @@ Note the possibility of negative confidence intervals if there are low counts ## weighted counts and proportion of dead death_props_strat <- survey_design %>% select(died, health_district) %>% - tbl_svysummary(type = died ~ "categorical", - by = health_district) %>% + tbl_svysummary(by = health_district) %>% ## add the weighted total add_n() %>% ## add in confidence intervals @@ -1734,13 +1731,13 @@ CMR_strat <- survey_design %>% In District A the weighted number and proportion of deaths was -`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "stat_1")`, +`r inline_text(death_props_strat, variable = "died", column = "stat_1")`, with a weighted confidence interval of -`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "ci_stat_1")`. +`r inline_text(death_props_strat, variable = "died", column = "ci_stat_1")`. In comparison, the weighted number and proportion of deaths in District B was -`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "stat_2")`, +`r inline_text(death_props_strat, variable = "died", column = "stat_2")`, the weighted confidence interval was -`r inline_text(death_props_strat, variable = "died", level = "TRUE", column = "ci_stat_2")`. +`r inline_text(death_props_strat, variable = "died", column = "ci_stat_2")`. The crude mortality rate in District A was `r CMR_strat %>% filter(health_district == "district_a") %>% pull(Mortality)` deaths per 10000 person-days and in District B was @@ -2028,6 +2025,10 @@ by age group. Note that low counts or short observation times may lead to a confidence interval that crosses zero (i.e. negative) for mortality ratios. These should be interpreted as if no deaths or recoded to zero (impossible to have negative deaths). +Note that confidence intervals would make this table crowded; in addition +groups with zero counts result in an error, from the original survey package. +If you would like to have confidence intervals we suggest only showing a subset +of the levels or groups in your data. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> ```{r weighted_death_cause_by_age, warning = FALSE} From edf1743ca530b0c63c561949fb0819ff4453fa95 Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Fri, 10 Feb 2023 13:49:32 +0000 Subject: [PATCH 6/8] add confidence int to nutrition --- .../templates/nutrition/skeleton/skeleton.Rmd | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd index 5af6463e..ddec7395 100644 --- a/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/nutrition/skeleton/skeleton.Rmd @@ -905,9 +905,9 @@ study_data_cleaned <- study_data_cleaned %>% mutate( across( .cols = c(stunting_haz, - moderate_stunting_haz, - severe_stunting_haz), # select the indicator variables - .funs = ~if_else(!is.na(flen) & flen == 1, NA, .))) # NA if flagged, else leave as is + moderate_stunting_haz, + severe_stunting_haz), # select the indicator variables + .fns = ~if_else(!is.na(flen) & flen == 1, NA, .))) # NA if flagged, else leave as is @@ -1993,7 +1993,9 @@ overall <- survey_design %>% select(all_of(MUAC)) %>% ## only show the row with TRUE tbl_svysummary(missing = "no", - value = everything() ~ TRUE) + value = everything() ~ TRUE) %>% + ## add confidence intervals + add_ci() age_strat <- survey_design %>% ## tabulate multiple variables with same values @@ -2010,7 +2012,8 @@ tbl_merge(list(overall, age_strat)) %>% list( ## rename the spanning header ## you can see what the columns are called by putting in an object and inspecting table_body - stat_0_1 ~ "**Overall**", + c(stat_0_1, + ci_stat_0_1) ~ "**Overall**", c(stat_1_2, stat_2_2, stat_3_2, @@ -2049,7 +2052,9 @@ overall <- survey_design %>% select(all_of(MUAC)) %>% ## only show the row with TRUE tbl_svysummary(missing = "no", - value = everything() ~ TRUE) + value = everything() ~ TRUE) %>% + ## add confidence intervals + add_ci() age_strat <- survey_design %>% ## only keep children less than 87cm @@ -2060,7 +2065,7 @@ age_strat <- survey_design %>% tbl_svysummary(missing = "no", value = everything() ~ TRUE, ## stratify by age group - by = age_group) + by = age_group) ## combine the overall and stratified tables tbl_merge(list(overall, age_strat)) %>% @@ -2068,7 +2073,8 @@ tbl_merge(list(overall, age_strat)) %>% list( ## rename the spanning header ## you can see what the columns are called by putting in an object and inspecting table_body - stat_0_1 ~ "**Overall**", + c(stat_0_1, + ci_stat_0_1) ~ "**Overall**", c(stat_1_2, stat_2_2, stat_3_2, @@ -2107,7 +2113,9 @@ overall <- survey_design %>% select(all_of(HAZ)) %>% ## only show the row with TRUE tbl_svysummary(missing = "no", - value = everything() ~ TRUE) + value = everything() ~ TRUE) %>% + ## add confidence intervals + add_ci() age_strat <- survey_design %>% ## tabulate multiple variables with same values @@ -2124,7 +2132,8 @@ tbl_merge(list(overall, age_strat)) %>% list( ## rename the spanning header ## you can see what the columns are called by putting in an object and inspecting table_body - stat_0_1 ~ "**Overall**", + c(stat_0_1, + ci_stat_0_1) ~ "**Overall**", c(stat_1_2, stat_2_2, stat_3_2, @@ -2162,7 +2171,9 @@ overall <- survey_design %>% select(all_of(WAZ)) %>% ## only show the row with TRUE tbl_svysummary(missing = "no", - value = everything() ~ TRUE) + value = everything() ~ TRUE) %>% + ## add confidence intervals + add_ci() age_strat <- survey_design %>% ## tabulate multiple variables with same values @@ -2179,7 +2190,8 @@ tbl_merge(list(overall, age_strat)) %>% list( ## rename the spanning header ## you can see what the columns are called by putting in an object and inspecting table_body - stat_0_1 ~ "**Overall**", + c(stat_0_1, + ci_stat_0_1) ~ "**Overall**", c(stat_1_2, stat_2_2, stat_3_2, @@ -2218,7 +2230,9 @@ overall <- survey_design %>% select(all_of(WHZ)) %>% ## only show the row with TRUE tbl_svysummary(missing = "no", - value = everything() ~ TRUE) + value = everything() ~ TRUE) %>% + ## add confidence intervals + add_ci() age_strat <- survey_design %>% ## tabulate multiple variables with same values @@ -2235,7 +2249,8 @@ tbl_merge(list(overall, age_strat)) %>% list( ## rename the spanning header ## you can see what the columns are called by putting in an object and inspecting table_body - stat_0_1 ~ "**Overall**", + c(stat_0_1, + ci_stat_0_1) ~ "**Overall**", c(stat_1_2, stat_2_2, stat_3_2, From 0f179a51ee869cd23f32f0c5a54f0f4001d214d5 Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Fri, 10 Feb 2023 15:41:42 +0000 Subject: [PATCH 7/8] add ci for vacc long --- .../vaccination_long/skeleton/skeleton.Rmd | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd index 1ea87a00..5a14dac8 100644 --- a/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/vaccination_long/skeleton/skeleton.Rmd @@ -1574,9 +1574,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1626,9 +1624,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1696,9 +1692,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1748,9 +1742,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1799,9 +1791,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1851,9 +1841,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1898,13 +1886,11 @@ survey_design %>% select(reason_vars$option_name) %>% tbl_svysummary(value = list(everything() ~ 1)) %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( - stat_0 ~ "**Weighted Count (n) \n (N={round(N, digits = 0)})**" + stat_0 ~ "Weighted Count (n) \n (N={round(N, digits = 0)})" ) ) %>% ## make variable names bold From 18a05f9d9dc84a8d74defdea0ea7dd36976caf18 Mon Sep 17 00:00:00 2001 From: Alex Spina Date: Fri, 10 Feb 2023 15:50:10 +0000 Subject: [PATCH 8/8] add ci to vacc short --- .../vaccination_short/skeleton/skeleton.Rmd | 48 +++++-------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd index 8fbd5250..a3ed6f50 100644 --- a/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/vaccination_short/skeleton/skeleton.Rmd @@ -1507,9 +1507,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1544,9 +1542,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1584,9 +1580,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1626,9 +1620,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1665,9 +1657,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1707,9 +1697,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1749,9 +1737,7 @@ survey_design %>% ## add the weighted total add_n() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1787,9 +1773,7 @@ survey_design %>% select(reason_route_vacc) %>% tbl_svysummary() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1822,9 +1806,7 @@ survey_design %>% select(reason_msf_vacc) %>% tbl_svysummary() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1856,9 +1838,7 @@ survey_design %>% select(reason_sia_vacc) %>% tbl_svysummary() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1889,9 +1869,7 @@ survey_design %>% select(diagnosis_disease) %>% tbl_svysummary() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list( @@ -1925,9 +1903,7 @@ survey_design %>% select(time_since_group) %>% tbl_svysummary() %>% ## add in confidence intervals - - ## add in deff - + add_ci() %>% ## modify the column headers modify_header( list(