Use of {epiparameter} in Rt pipeline #18
Replies: 5 comments 1 reply
-
|
This is great, thanks for sharing! Just a couple of comments relating to EpiNow2: We're thinking of making the column names more flexible in EpiNow2, which would address this to some degree. We could also add an S3 method to accept incidence2 objects but I'm not sure it's worth the overhead if all it does is rename some columns (happy to convinced otherwise). This is largely a consequence of the settings used. We're hoping to clarify this in the future: |
Beta Was this translation helpful? Give feedback.
-
TODO-1# transform LL into incidence TS
inc_sle <-
incidence2::incidence(data_sle, date_index = "DateOnset") %>%
complete(
date_index = seq(min(date_index), max(date_index), 1),
fill = list(count = 0, count_variable = "DateOnset")
) # add missing dates with 0 counts
# TODO-1: it would be nice to have an option in incidence
# to add missing 0 when interval is specified
# e.g. incidence2::incidence(data_sle, date_index = "DateOnset", interval = "day", complete = TRUE)currently you can do to achieve the same. That said , this has been requested before though so I will add a TODO-9# TODO-9: epinow accept incidence2 objectsI've various thoughts here but I currently lean towards one of:
Either way, happy to help out here as needed. |
Beta Was this translation helpful? Give feedback.
-
TODO-6# epiestim v1
# TODO-6: epiestim should accept incidence2 objectsSimilar thoughts to above. Happy to work this through with you either way. |
Beta Was this translation helpful? Give feedback.
-
|
@annecori , @ntncmch - I've just release incidence 2.3.0 to CRAN (binaries waiting to be built but source there) and you can now do: inc_sle <-
incidence2::incidence(data_sle, date_index = "DateOnset", complete_dates = TRUE)hopefully that crosses off TODO-1. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for contributing this @ntncmch and @annecori, and for pointing out the areas where improvements were needed. It's also great to see other package developers incorporating the suggestions. TODO-4
This has been addressed in epiverse-trace/epiparameter#335 and is available by reinstalling the package. Here is a run through with the updates: library(epiparameter)
library(epireview)
#> Loading required package: epitrix
#> Loading required package: ggplot2
#> Loading required package: ggforcelibrary(tidyverse)
# get Ebola serial interval from EpiReview via Epiparameter
ebola <- epireview::load_epidata("ebola")
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> Warning in load_epidata_raw(pathogen, "outbreak"): No data found for ebola
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> Warning in epireview::load_epidata("ebola"): No outbreaks information found for
#> ebola
#> Data loaded for ebolaparams <- ebola[["params"]]
# we use Faye study for our estimates
# this is an arbitrary choice, we looked for study with both mean and SD estimate
param_evd_faye <- params %>% filter(covidence_id == 4966)
# get serial interval (2 lines: mean + sd)
serial_interval_faye <-
param_evd_faye %>% filter(parameter_type == "Human delay - serial interval")
serial_interval_faye %>% select(
pathogen,
article_label,
parameter_type,
parameter_value_type,
parameter_value,
parameter_unit
)
#> # A tibble: 2 × 6
#> pathogen article_label parameter_type parameter_value_type parameter_value
#> <chr> <chr> <chr> <chr> <dbl>
#> 1 Ebola virus Faye 2015 (a)… Human delay -… Mean 14.2
#> 2 Ebola virus Faye 2015 (a)… Human delay -… Standard Deviation 7.1
#> # ℹ 1 more variable: parameter_unit <chr># create epidist object from epireview
evd_SI_ep <- epiparameter:::as_epidist(serial_interval_faye, prob_dist = "gamma")
#> Using Faye (2015). "<title not available>." _<journal not available>_.
#> To retrieve the citation use the 'get_citation' function
#> Warning: Cannot create full citation for epidemiological parameters without bibliographic information
#> see ?as_epidist for help.is_parameterised(evd_SI_ep)
#> [1] TRUEplot(evd_SI_ep)evd_SI_pmf <- density(discretize(evd_SI_ep), at = 0:50)Created on 2024-06-28 with reprex v2.1.0 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Here is the R script by @annecori and @ntncmch that attempts to use the {epiparameter} package in a typical Rt estimation pipeline, using both {EpiEstim} and {EpiNow2}.
The 10 problems discovered are marked with
# TODO-1,2,etc. It remains to be discussed whether these issues should be posted on {epiparameter} or in other packages.Beta Was this translation helpful? Give feedback.
All reactions