Closed CarmenTamayo closed 4 months ago
This could also be considered for an enhancement of <epidist>
to "fill-in" all the parameters and summary metrics possible, which is it currently only doing for the distribution parameters. In theory it is possible to go from median & range -> parameters -> mean and sd.
@Bisaloo do you think this functionality should live in {epiparameter}?
It's probably good to not do it by default to ensure the database is as close to the raw data as possible. But I can see having a specific method or function for this.
Following up on this issue, what are your thoughts on expanding the number of parameters in the template or in adding a method to fill in all the summary statistics to epiparameter
?
I'm not completely clear on how expanding the number of parameters in the template would help.
We need to create si_mean
and si_sd
from the epidist object if they are not already present. This can be done in epiparameter of with a helper function in episoap.
In this case I meant to expand the parameters in the template to allow users to provide other summary statistics, e.g., median/range/percentiles, otherwise how would they input these values?
allow users to provide other summary statistics, e.g., median/range/percentiles, otherwise how would they input these values?
I'd rather be opinionated here to not end up with an unwieldy result. If users provide their own distribution, they can only do so via mean & sd. We can mention epiparameter in the docs as a good tool to convert parameters if needed.
okay, in that case I can close the issue here and if this functionality is added to epiparameter
then we can change the transmissibility template in the future?
You can use something like the reprex below to flexibly display params based on what was provided to epiparameter:
library(epiparameter)
library(magrittr)
ed <- epiparameter::epidist_db(
"covid-19",
"incubation_period",
single_epidist = TRUE
)
#> Using McAloon C, Collins Á, Hunt K, Barber A, Byrne A, Butler F, Casey M,
#> Griffin J, Lane E, McEvoy D, Wall P, Green M, O'Grady L, More S (2020).
#> "Incubation period of COVID-19: a rapid systematic review and
#> meta-analysis of observational research." _BMJ Open_.
#> doi:10.1136/bmjopen-2020-039652
#> <https://doi.org/10.1136/bmjopen-2020-039652>..
#> To retrieve the short citation use the 'get_citation' function
sprintf("%s: %s", names(get_parameters(ed)), get_parameters(ed)) %>%
paste(collapse = "; ")
#> [1] "meanlog: 1.66; sdlog: 0.48"
Created on 2024-01-30 with reprex v2.0.2
Currently the user is expected to provide a mean and sd, which are converted using epiparameter to distribution parameters. However, some studies provide the median and range or percentiles, in which case it's necessary to estimate the parameters via extraction (see {epiparameter} vignette)
Further, since only the mean and sd are accepted as summary statistics, the plotting function does not work adequately for studies from the epiparameter database that do not include these 2 parameters as this function expects them to generate a legend:
ggplot( data.frame(delay = si_x, prob = si$prob_dist$d(si_x)), aes(x = delay, y = prob) ) + geom_col(fill = green_grey) + labs( title = "Serial interval distribution", x = "Days from primary to secondary onset", y = "Probability", subtitle = sprintf( "%s distribution | mean: %.1f days ; sd: %.1f days", si_dist, si_mean, si_sd ) )
Should we allow users to also provide other summary statistics, apart from mean and sd? The epiparameter function
calc_dist_params
could be used to facilitate the process. This would however increase the number of parameters on the params list (#106)