From 57c553dcaaf2b465cdc68ea41897461853b72112 Mon Sep 17 00:00:00 2001 From: athowes Date: Fri, 13 Sep 2024 10:15:03 +0100 Subject: [PATCH 1/4] Shorten title --- vignettes/ebola.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/ebola.Rmd b/vignettes/ebola.Rmd index 9d4ef04a7..06f37c1e4 100644 --- a/vignettes/ebola.Rmd +++ b/vignettes/ebola.Rmd @@ -1,5 +1,5 @@ --- -title: "Using `epidist` to estimate stratified delays between symptom onset and positive test for the 2014-2016 Ebola outbreak in Sierra Leone" +title: "Using epidist to estimate delay between symptom onset and positive test for an Ebola outbreak in Sierra Leone" description: "A more detailed guide to using the `epidist` R package" output: bookdown::html_document2: From c25ff34dad53d96d132d37e18e3eb98f8af4140c Mon Sep 17 00:00:00 2001 From: athowes Date: Fri, 13 Sep 2024 10:15:22 +0100 Subject: [PATCH 2/4] Don't think ` will work here either --- vignettes/ebola.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/ebola.Rmd b/vignettes/ebola.Rmd index 06f37c1e4..51ac18eaf 100644 --- a/vignettes/ebola.Rmd +++ b/vignettes/ebola.Rmd @@ -1,6 +1,6 @@ --- title: "Using epidist to estimate delay between symptom onset and positive test for an Ebola outbreak in Sierra Leone" -description: "A more detailed guide to using the `epidist` R package" +description: "A more detailed guide to using the epidist R package" output: bookdown::html_document2: fig_caption: yes From 4ae6b541b5ceb9b6f60c52e20c88b60f98ffa2a7 Mon Sep 17 00:00:00 2001 From: athowes Date: Fri, 13 Sep 2024 10:17:10 +0100 Subject: [PATCH 3/4] Try making figure C bigger --- vignettes/ebola.Rmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vignettes/ebola.Rmd b/vignettes/ebola.Rmd index 51ac18eaf..0d37edb1b 100644 --- a/vignettes/ebola.Rmd +++ b/vignettes/ebola.Rmd @@ -431,9 +431,9 @@ pmf_sex_district_figure <- draws_sex_district_pmf |> (ref:pmf) Posterior predictions of the discrete probability mass function for each of the fitted models. -```{r pmf, fig.cap="(ref:pmf)", fig.height = 9} +```{r pmf, fig.cap="(ref:pmf)", fig.height = 12} pmf_base_figure / pmf_sex_figure / pmf_sex_district_figure + - plot_layout(heights = c(1, 1.5, 3)) + plot_layout(heights = c(1, 1.5, 3.5)) ``` ### Continuous probability density function @@ -487,9 +487,9 @@ pdf_sex_district_figure <- draws_sex_district_pdf |> (ref:pdf) Posterior predictions of the continuous probability density function for each of the fitted models. -```{r pdf, fig.cap="(ref:pdf)", fig.height = 9} +```{r pdf, fig.cap="(ref:pdf)", fig.height = 12} pdf_base_figure / pdf_sex_figure / pdf_sex_district_figure + - plot_layout(heights = c(1, 1.5, 3)) + plot_layout(heights = c(1, 1.5, 3.5)) ``` # Conclusion From 744ed0c29f0dc4b05bb370164f7a25b5148692e5 Mon Sep 17 00:00:00 2001 From: athowes Date: Fri, 13 Sep 2024 11:00:49 +0100 Subject: [PATCH 4/4] Fix facet and after_stat, make panel C bigger, put two word districts to have new line --- vignettes/ebola.Rmd | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/vignettes/ebola.Rmd b/vignettes/ebola.Rmd index 0d37edb1b..e764eabb8 100644 --- a/vignettes/ebola.Rmd +++ b/vignettes/ebola.Rmd @@ -405,7 +405,7 @@ draws_sex_pmf <- obs_prep |> pmf_sex_figure <- draws_sex_pmf |> ggplot(aes(x = .prediction)) + - geom_bar(aes(y = after_stat(count / sum(count)))) + + geom_bar(aes(y = after_stat(count / ave(count, PANEL, FUN = sum)))) + labs(x = "", y = "", title = "Sex-stratified", tag = "B") + facet_grid(. ~ sex) + scale_x_continuous(limits = c(0, 30)) + @@ -418,8 +418,16 @@ draws_sex_district_pmf <- obs_prep |> add_predicted_draws(fit_sex_district, ndraws = 1000) pmf_sex_district_figure <- draws_sex_district_pmf |> + mutate( + district = case_when( + district == "Port Loko" ~ "Port\nLoko", + district == "Western Rural" ~ "Western\nRural", + district == "Western Urban" ~ "Western\nUrban", + .default = district + ) + ) |> ggplot(aes(x = .prediction)) + - geom_bar(aes(y = after_stat(count / sum(count)))) + + geom_bar(aes(y = after_stat(count / ave(count, PANEL, FUN = sum)))) + labs( x = "PMF with daily censoring and no truncation", y = "", title = "Sex-district-stratified", tag = "C" @@ -431,9 +439,9 @@ pmf_sex_district_figure <- draws_sex_district_pmf |> (ref:pmf) Posterior predictions of the discrete probability mass function for each of the fitted models. -```{r pmf, fig.cap="(ref:pmf)", fig.height = 12} +```{r pmf, fig.cap="(ref:pmf)", fig.height = 16} pmf_base_figure / pmf_sex_figure / pmf_sex_district_figure + - plot_layout(heights = c(1, 1.5, 3.5)) + plot_layout(heights = c(1, 1.5, 5.5)) ``` ### Continuous probability density function @@ -474,6 +482,14 @@ draws_sex_district_pdf <- obs_prep |> add_predicted_draws(fit_sex_district, ndraws = 1000) pdf_sex_district_figure <- draws_sex_district_pdf |> + mutate( + district = case_when( + district == "Port Loko" ~ "Port\nLoko", + district == "Western Rural" ~ "Western\nRural", + district == "Western Urban" ~ "Western\nUrban", + .default = district + ) + ) |> ggplot(aes(x = .prediction)) + geom_density() + labs( @@ -487,9 +503,9 @@ pdf_sex_district_figure <- draws_sex_district_pdf |> (ref:pdf) Posterior predictions of the continuous probability density function for each of the fitted models. -```{r pdf, fig.cap="(ref:pdf)", fig.height = 12} +```{r pdf, fig.cap="(ref:pdf)", fig.height = 16} pdf_base_figure / pdf_sex_figure / pdf_sex_district_figure + - plot_layout(heights = c(1, 1.5, 3.5)) + plot_layout(heights = c(1, 1.5, 5.5)) ``` # Conclusion