Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting parameters on the transmissibility template #115

Closed
CarmenTamayo opened this issue Dec 11, 2023 · 8 comments
Closed

Extracting parameters on the transmissibility template #115

CarmenTamayo opened this issue Dec 11, 2023 · 8 comments

Comments

@CarmenTamayo
Copy link
Contributor

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)

@joshwlambert
Copy link
Member

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}?

@Bisaloo
Copy link
Member

Bisaloo commented Dec 12, 2023

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.

@CarmenTamayo
Copy link
Contributor Author

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?

@Bisaloo
Copy link
Member

Bisaloo commented Jan 9, 2024

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.

@CarmenTamayo
Copy link
Contributor Author

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?

@Bisaloo
Copy link
Member

Bisaloo commented Jan 9, 2024

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.

@CarmenTamayo
Copy link
Contributor Author

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?

@Bisaloo
Copy link
Member

Bisaloo commented Jan 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants