how to read the epidist$prob_dist
ouput?
#228
-
Given an example in the The first one is the library(epiparameter)
library(distributional)
covid_serialint <-
epiparameter::epidist_db(
disease = "covid",
epi_dist = "serial",
author = "Nishiura",
single_epidist = T
)
#> Using Nishiura H, Linton N, Akhmetzhanov A (2020). "Serial interval of novel
#> coronavirus (COVID-19) infections." _International Journal of
#> Infectious Diseases_. doi:10.1016/j.ijid.2020.02.060
#> <https://doi.org/10.1016/j.ijid.2020.02.060>..
#> To retrieve the short citation use the 'get_citation' function
covid_serialint
#> Disease: COVID-19
#> Pathogen: SARS-CoV-2
#> Epi Distribution: serial interval
#> Study: Nishiura H, Linton N, Akhmetzhanov A (2020). “Serial interval of novel coronavirus
#> (COVID-19) infections.” _International Journal of Infectious Diseases_.
#> doi:10.1016/j.ijid.2020.02.060 <https://doi.org/10.1016/j.ijid.2020.02.060>.
#> Distribution: lnorm
#> Parameters:
#> meanlog: 1.386
#> sdlog: 0.568
# How to read this notation?
covid_serialint$prob_dist
#> <distribution[1]>
#> [1] lN(1.4, 0.32)
# This object is class `distribution`
class(covid_serialint$prob_dist)
#> [1] "distribution" "vctrs_vctr" "list"
# so a reference would be:
# ?distributional::dist_lognormal()
# Is there a handy way to interpret this?
# just in case
# if we unlist the parameters, the output is reproducible
covid_serialint_parameters <- unlist(covid_serialint$prob_dist)
distributional::dist_lognormal(
mu = covid_serialint_parameters[1],
sigma = covid_serialint_parameters[2]
)
#> <distribution[1]>
#> mu
#> lN(1.4, 0.32) Created on 2023-12-14 with reprex v2.0.2 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@avallecam apologies for not getting back to you sooner on this, I had missed it. The best approach is the use the library(epiparameter)
covid_serialint <-
epiparameter::epidist_db(
disease = "covid",
epi_dist = "serial",
author = "Nishiura",
single_epidist = T
)
#> Using Nishiura H, Linton N, Akhmetzhanov A (2020). "Serial interval of novel
#> coronavirus (COVID-19) infections." _International Journal of
#> Infectious Diseases_. doi:10.1016/j.ijid.2020.02.060
#> <https://doi.org/10.1016/j.ijid.2020.02.060>..
#> To retrieve the short citation use the 'get_citation' function
get_parameters(covid_serialint)
#> meanlog sdlog
#> 1.3862617 0.5679803 Created on 2024-02-29 with reprex v2.0.2 See also the |
Beta Was this translation helpful? Give feedback.
@avallecam apologies for not getting back to you sooner on this, I had missed it.
The best approach is the use the
get_parameters()
function from {epiparameter}. The$prob_dist
element is one of the most complex in the<epidist>
object (because {distributional} is not the easiest to use when users are not familiar with vector classes, and it can be a<distcrete>
object), therefore, the approach we take is to provide functions to extract data from this element rather than users extracting it directly, for example using$
.