Skip to content

Commit

Permalink
Issue 48: Ebola vignette (#52)
Browse files Browse the repository at this point in the history
* Template for second vignette

* Add ebola data and figure

* Add segments and reference for data

* Better title and cleaning up of data into ptime and stime format

* Working through the processing of data

* Merge references

* Use @ for reference

* More clarity on what's going on in Ebola data preparation section

* Start with model fitting section

* Statement of intent about what the vignette might contain

* Start getting shapefiles for plot / spatial analysis

* Figure of SL spatial working

* Further writing

* Update introduction writing

* Start to correct Ebola vignette

* Trying to line up shapefile chiefdom names

* Use districts over chiefdoms, start trying to fit district-sex level delay models

* Move out things we don't need and start fitting stratified models with subsampling and Laplace for now

* Trying out tidybayes

* It works!

* Better laying out the things wanted in this vignette

* Move library to top, improve plot, add text

* The small districts are worse, but I still think the priors are wrong

* Add fitting with gamma

* Add column descriptions

* Testing prediction tidybayes functions

* Replace epidist::epidist by epidist

* Improvements to writing, looking at the linear predictors, attempting to do posterior predictions

* Add sf dependency

* Lint

* Add modelr to suggests

* Move fraction, add dplyr:: to select, and create PMF and PDF figures

* Add SLE shapefiles

* This question is now an issue

* Remove warnings, make brms silent, filter to only data with >30 points, produce all epred and pred figures, add conclusion

* Work through more writing in the vignette

* Lint vignette and aim to make reproducible

* Correct error that prevents render

* Some wording fixes

* Remove dplyr:: and put library(dplyr)

* Use system.file

* Remove modelr:: and tidybayes:: apart from in text

* Put () after functions to get link in pkgdown

* Add link to pkgdown header

* Reproduce summary level of rounding inline

* Moved to issue

* All figures in own chunk

* Move rvars to issue

* Fix first x-axis

* Remove complaining about KDE

* Text update

* Use "lognormal" not brms::lognormal()

* Add figure captions to all figures

* Remove parts about gamma and model comparison

* Be specific about the dates

* Improve intercept only text

Co-authored-by: Katie Gostic (she/her) <kategostic@gmail.com>

* Comment about lubridate

Co-authored-by: Katie Gostic (she/her) <kategostic@gmail.com>

* Add comment on ptime and stime

Co-authored-by: Katie Gostic (she/her) <kategostic@gmail.com>

* Comment on using all available data

* Move column descriptions into function roxygen

* Set all x-axis limits to 30, and set pwindow_upr and swindow_upr to 0 now that it's possible

* More verbose on sex-stratified model

Co-authored-by: Katie Gostic (she/her) <kategostic@gmail.com>

* Note on interpreting the summary

* Make introduction shorter

* Lint package

* Collapse plots into a 3 level patchwork (part 1)

* Update documentation

* More collapse 3 plots into patchwork

* Correct figure chunk name

* Range of improvements to Ebola vignette (sorry for squashed commit message)

* Add head(obs_prep)

Co-authored-by: Katie Gostic (she/her) <kategostic@gmail.com>

* Add patchwork to suggests

* Don't need sec:

---------

Co-authored-by: Katie Gostic (she/her) <kategostic@gmail.com>
Former-commit-id: 0b0032e
Former-commit-id: 762cfc5305b1095350d0a4c965c0a100aba983bf
Former-commit-id: b7cd78a5aa14e0dcaac942848a0a9f1c222057cb [formerly 5577850]
Former-commit-id: 584b9616264ba79cde4198770095488d4c5564a5
  • Loading branch information
athowes and kgostic authored Sep 9, 2024
1 parent 6df9220 commit 189afca
Show file tree
Hide file tree
Showing 26 changed files with 601 additions and 2 deletions.
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ Suggests:
tidyr,
posterior,
fs,
tidybayes
sf,
tidybayes,
modelr,
patchwork
Remotes:
stan-dev/cmdstanr,
Rdatatable/data.table,
Expand Down
14 changes: 14 additions & 0 deletions R/observe.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#' Observation process for primary and secondary events
#'
#' This function adds columns to linelist data representing an observation
#' process with daily primary and secondary censoring, as well as right
#' truncation. The columns added are:
#' * `ptime_daily`: The floor of `ptime`
#' * `ptime_lwr`: The lower bound of `ptime`. Equal to `ptime_daily`
#' * `ptime_upr`: The upper bound of `ptime`. Equal to `ptime_lwr + 1`
#' * `stime_daily`: The floor of `stime`
#' * `stime_lwr`: The lower bound of `stime`. Equal to `stime_daily`
#' * `stime_upr`: The upper bound of `stime`. Equal to `stime_lwr + 1`
#' * `delay_daily`: Given by `stime_daily - ptime_daily`
#' * `delay_lwr`: Given by `delay_daily - 1` (or 0 if `delay_daily < 1`)
#' * `delay_upr`: Given by `delay_daily + 1`
#' * `obs_at`: The maximum value of `stime`
#'
#' @param linelist ...
#' @family observe
#' @autoglobal
Expand Down
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ navbar:
articles:
text: Articles
menu:
- text: Advanced features with Ebola data
href: articles/ebola.html
- text: Approximate Bayesian inference
href: articles/approx-inference.html

Expand Down
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_0.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_0.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_0.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_0.shp
Binary file not shown.
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_0.shx
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_1.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_1.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_1.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_1.shp
Binary file not shown.
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_1.shx
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_2.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_2.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_2.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_2.shp
Binary file not shown.
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_2.shx
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_3.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_3.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_3.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
1 change: 1 addition & 0 deletions inst/gadm41_SLE_shp/gadm41_SLE_3.shp.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
767ca43a6e31cb04ea37a21a807badd8a1632b41
Binary file added inst/gadm41_SLE_shp/gadm41_SLE_3.shx
Binary file not shown.
16 changes: 15 additions & 1 deletion man/observe_process.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 189afca

Please sign in to comment.