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

Update Epidemic risk vignette #44

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion vignettes/epidemic_risk.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,20 @@ had superspreading events. The detection of variability in individual-transmissi
is important in understanding or predicting the likelihood of transmission establishing
when imported into a new location (e.g. country).

First we set up the parameters to use for calculating the probability of an
epidemic. In this case we are varying the heterogeneity of transmission (`k`)
and number of initial infections (`a`).

```{r, prep-dispersion-plot}
epidemic_params <- expand.grid(
R = 2.35, R_lw = 1.5, R_up = 3.2, k = seq(0, 1, 0.1), a = seq(0, 10, 1)
)
```

Then we calculate the probability of an epidemic for each parameter combination.
The results are combined with the the parameters.

```{r, calc-prob-endemic}
# results are transposed to pivot to long rather than wide data
prob_epidemic <- t(apply(epidemic_params, 1, function(x) {
median <- probability_epidemic(R = x[["R"]], k = x[["k"]], a = x[["a"]])
Expand All @@ -65,7 +75,12 @@ prob_epidemic <- t(apply(epidemic_params, 1, function(x) {
c(prob_epidemic = median, prob_epidemic_lw = lower, prob_epidemic_up = upper)
}))
epidemic_params <- cbind(epidemic_params, prob_epidemic)
```

To visualise the influence of transmission variation (`k`) we subset the results
to only include those with a single initial infection seeding transmission (`a = 1`).

```{r, subset-prob-epidemic}
# subset data for a single initial infection
homogeneity <- subset(epidemic_params, a == 1)
```
Expand Down Expand Up @@ -222,6 +237,15 @@ contains a library of epidemiological parameters included offspring distribution
Equipped with these parameter estimates, metrics that provide an intuitive understanding of transmission patterns can be tabulated.
For example the proportion of transmission events in a given cluster size can be calculated using the {superspreading} function `proportion_cluster_size()`.

This calculates the proportion of new cases that originated within a transmission event of a
given size. In other words, what proportion of all transmission events were part of secondary
case clusters (i.e. from the same primary case) of at least, for example, five cases. This
calculation is useful to inform backwards contact tracing efforts.

In this example we look at clusters of at least five, ten and twenty-five secondary cases, at
different numbers of initial infections and for two reproduction numbers to see how this affects
cluster sizes.

```{r}
# For R = 0.8
proportion_cluster_size(
Expand All @@ -238,7 +262,12 @@ proportion_cluster_size(
)
```

These results indicate whether preventing gatherings of a certain size can reduce the epidemic
These results show that as the level of heterogeneity in individual-level
transmission increases, a larger percentage of cases come from larger cluster sizes,
and that large clusters can be produced when $R$ is higher even with low levels of
transmission variation.

It indicates whether preventing gatherings of a certain size can reduce the epidemic
by preventing potential superspreading events.

When data on the settings of transmission is known, priority can be given to restricting
Expand Down