Skip to content

Commit

Permalink
updated wording of epiparameter vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Sep 6, 2023
1 parent 029199a commit e7bac0a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vignettes/epiparameter.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ The {epiparameter} R package is a library of epidemiological parameters, with cl
::: {.alert .alert-primary}
### Use case

An outbreak of a known or potentially novel pathogen is detected and the parameters and a delay distribution (e.g. incubation period or serial interval) is required.
An outbreak of a known or potentially novel pathogen is detected and key parameters such as delay distributions (e.g. incubation period or serial interval) are required to interpret early data.

{epiparameter} can provide these distributions from a selection of published sources in order to provide reliable epidemiological parameters.
{epiparameter} can provide these distributions from a selection of published sources, such as past analysis of the same or similar pathogen, in order to provide relevant epidemiological parameters for new analysis.
:::

This vignette will provide a introduction to the data stored within {epiparameter}, how to read it into R, manipulate
Expand Down Expand Up @@ -66,18 +66,18 @@ head(epi_dist_db)[, 1:5]
tail(epi_dist_db)[, 1:5]
```

The epidemiological library contains quite a few different columns:
The epidemiological library contains multiple columns, each storing different features of the parameter:

```{r, epiparam-cols}
colnames(epi_dist_db)
```

If subsetting of the `<epiparam>` object removes one of the crucial columns then the object is
converted to a data frame. Here removing the `disease` column causes the `<epiparam>` object
If subsetting of the `<epiparam>` object removes one of the essential columns then the object is
converted to a data frame. For example, removing the `disease` column causes the below `<epiparam>` object
to be converted to a data frame. See the Epiverse-TRACE [blog post on extending data frames](https://epiverse-trace.github.io/posts/extend-dataframes/) for a more technical description.

```{r, epiparam-subset-disease}
epi_dist_df <- epi_dist_db[-which(colnames(epi_dist_db) == "disease")]
epi_dist_df <- epi_dist_db[colnames(epi_dist_db) != "disease"]
```

To see a full list of the diseases and distributions stored in the library use the
Expand Down Expand Up @@ -150,14 +150,14 @@ ebola_incubation <- epidist(
::: {.alert .alert-success}
### Benefit of `<epidist>`

By providing a consistent and robust object to store epidemiological parameters, `<epidist>` objects can be applied in epidemiological pipelines, for example [{episoap}](https://github.com/epiverse-trace/episoap). The data contained within the object (e.g. parameter values, pathogen type, etc.) can be modified but the pipeline will operate as the class is unchanged.
By providing a consistent and robust object to store epidemiological parameters, `<epidist>` objects can be applied in epidemiological pipelines, for example [{episoap}](https://github.com/epiverse-trace/episoap). The data contained within the object (e.g. parameter values, pathogen type, etc.) can be modified but the pipeline will continue to operate because the class is unchanged.
:::

The probability distribution (`prob_distribution`) argument requires the distribution specified in the standard R naming. In some cases these are the same as the distribution's name, e.g., `gamma` and `weibull`. Examples of where the distribution name and R name differ are lognormal and `lnorm`, negative binomial and `nbinom`, geometric and `geom`, and poisson and `pois`. Extra arguments are also available in `epidist()` to add information on uncertainty and citation information.

## Adding library entries

If a set of epidemiological parameter has been inferred and known to the user but has not yet been incorporated into the {epiparameter} database, these parameters can be manually added to the library.
If a set of epidemiological parameter has been inferred and is known to the user but has not yet been incorporated into the {epiparameter} database, these parameters can be manually added to the library.

To add entries to the library we provide a function to bind data to `<epiparam>` objects: `bind_epiparam()`. This function is provided as multiple data types (classes) can be bound to an existing `<epiparam>` object (which itself is a subclass of a `<data.frame>`). `bind_epiparam()` can bind `<epiparam>`, `<epidist>` (including `<vb_epdist>`), `<data.frames>` and `lists`.

Expand All @@ -172,7 +172,7 @@ For binding columns to `<epiparam>` use either `tibble::add_column()` or `dplyr:

## Distribution functions

`<epidist>` objects store distributions, and mathematical functions of these distribution can easily be extracted directly from them. It is commonly required to extract the probability density function, cumulative distribution function, quantile or generate random numbers from the distribution in the `<epidist>` object. The distribution functions in {epiparameter} allow users to easily access these aspects.
`<epidist>` objects store distributions, and mathematical functions of these distribution can easily be extracted directly from them. It is often useful to access the probability density function, cumulative distribution function, quantiles of the distribution, or generate random numbers from the distribution in the `<epidist>` object. The distribution functions in {epiparameter} allow users to easily use these.

```{r epidist-dist-methods}
density(ebola_incubation, at = 0.5)
Expand Down Expand Up @@ -201,7 +201,7 @@ This plotting function can be useful for visually comparing epidemiological dist

### Conversion

Parameters are often reported as mean and standard deviation (or variance). These can be (analytically) converted to the parameters of the distribution using the conversion function in the package (`convert_summary_stats_to_params()`). We also provide conversion functions in the opposite direction, parameters to summary statistics (`convert_params_to_summary_stats()`).
Parameters are often reported in the literature as mean and standard deviation (or variance). These summary statistics can often be (analytically) converted to the parameters of the distribution using the conversion function in the package (`convert_summary_stats_to_params()`). We also provide conversion functions in the opposite direction, parameters to summary statistics (`convert_params_to_summary_stats()`).

### Extraction

Expand Down

0 comments on commit e7bac0a

Please sign in to comment.