Skip to content

Commit 7025362

Browse files
committed
differences for PR #128
1 parent 00a97c4 commit 7025362

8 files changed

Lines changed: 5299 additions & 18 deletions

File tree

.DS_Store

-6 KB
Binary file not shown.

config.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#------------------------------------------------------------
2+
# Values for this lesson.
3+
#------------------------------------------------------------
4+
5+
# Which carpentry is this (swc, dc, lc, or cp)?
6+
# swc: Software Carpentry
7+
# dc: Data Carpentry
8+
# lc: Library Carpentry
9+
# cp: Carpentries (to use for instructor training for instance)
10+
# incubator: The Carpentries Incubator
11+
carpentry: 'epiverse-trace'
12+
13+
# Overall title for pages.
14+
title: 'Scenario modelling for outbreak analytics with R'
15+
16+
# Date the lesson was created (YYYY-MM-DD, this is empty by default)
17+
created:
18+
19+
# Comma-separated list of keywords for the lesson
20+
keywords: 'epidemic models, interventions'
21+
22+
# Life cycle stage of the lesson
23+
# possible values: pre-alpha, alpha, beta, stable
24+
life_cycle: 'pre-alpha'
25+
26+
# License of the lesson materials (recommended CC-BY 4.0)
27+
license: 'CC-BY 4.0'
28+
29+
# Link to the source repository for this lesson
30+
source: 'https://github.com/epiverse-trace/tutorials-late'
31+
32+
# Default branch of your lesson
33+
branch: 'main'
34+
35+
# Who to contact if there are any issues
36+
contact: 'andree.valle-campos@lshtm.ac.uk'
37+
38+
# Navigation ------------------------------------------------
39+
#
40+
# Use the following menu items to specify the order of
41+
# individual pages in each dropdown section. Leave blank to
42+
# include all pages in the folder.
43+
#
44+
# Example -------------
45+
#
46+
# episodes:
47+
# - introduction.md
48+
# - first-steps.md
49+
#
50+
# learners:
51+
# - setup.md
52+
#
53+
# instructors:
54+
# - instructor-notes.md
55+
#
56+
# profiles:
57+
# - one-learner.md
58+
# - another-learner.md
59+
60+
# Order of episodes in your lesson
61+
episodes:
62+
- contact-matrices.Rmd
63+
- simulating-transmission.Rmd
64+
- model-choices.Rmd
65+
- modelling-interventions.Rmd
66+
- compare-interventions.Rmd
67+
- vaccine-comparisons.Rmd
68+
- disease-burden.Rmd
69+
70+
# Information for Learners
71+
learners:
72+
73+
# Information for Instructors
74+
instructors:
75+
76+
# Learner Profiles
77+
profiles:
78+
79+
# Customisation ---------------------------------------------
80+
#
81+
# This space below is where custom yaml items (e.g. pinning
82+
# sandpaper and varnish versions) should live
83+
84+
85+
varnish: epiverse-trace/varnish@epiversetheme
86+
sandpaper: epiverse-trace/sandpaper@patch-renv-github-bug

contact-matrices.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ $$
6262
1 & 3
6363
\end{bmatrix}
6464
$$
65+
6566
In this example, we would use this to represent that children meet, on average, 2 other children and 2 adult per day (first row), and adults meet, on average, 1 child and 3 other adults per day (second row). We can use this kind of information to account for the role heterogeneity in contact plays in infectious disease transmission.
6667

6768
::::::::::::::::::::::::::::::::::::: callout
@@ -314,6 +315,7 @@ $$
314315
\frac{dR}{dt} &=\gamma I \\
315316
\end{aligned}
316317
$$
318+
317319
To add age structure to our model, we need to add additional equations for the infection states $S$, $I$ and $R$ for each age group $i$. If we want to assume that there is heterogeneity in contacts between age groups then we must adapt the transmission term $\beta SI$ to include the contact matrix $C$ as follows :
318320

319321
$$ \beta S_i \sum_j C_{i,j} I_j/N_j. $$

md5sum.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"config.yaml" "a0c04c1d43ce0640c3ea333b140e89c8" "site/built/config.yaml" "2025-11-22"
55
"index.md" "32bc80d6f4816435cc0e01540cb2a513" "site/built/index.md" "2025-11-22"
66
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2025-11-22"
7-
"episodes/contact-matrices.Rmd" "19856620d33f9b7f4e8ee312460494f1" "site/built/contact-matrices.md" "2025-11-22"
8-
"episodes/simulating-transmission.Rmd" "3e3ecf82148896a33189045d704f9606" "site/built/simulating-transmission.md" "2025-11-22"
7+
"episodes/contact-matrices.Rmd" "9e9d596cf25f68a50522b15a234472ac" "site/built/contact-matrices.md" "2025-11-22"
8+
"episodes/simulating-transmission.Rmd" "539a63b7a617e7a40ad1c5dd9650d96f" "site/built/simulating-transmission.md" "2025-11-22"
99
"episodes/model-choices.Rmd" "aa195e66455fb6a97b4930fd08c08001" "site/built/model-choices.md" "2025-11-22"
10-
"episodes/modelling-interventions.Rmd" "79b561f3ee274407dddbda6a1b9c1a68" "site/built/modelling-interventions.md" "2025-11-22"
10+
"episodes/modelling-interventions.Rmd" "8b9d77d31ac2672f4278b780e3d943db" "site/built/modelling-interventions.md" "2025-11-22"
1111
"episodes/compare-interventions.Rmd" "2ef6697bbad9bcfb843ab9d50469123b" "site/built/compare-interventions.md" "2025-11-22"
1212
"episodes/vaccine-comparisons.Rmd" "bb9110b17b2b5cdc915df3f17eae15df" "site/built/vaccine-comparisons.md" "2025-11-22"
1313
"episodes/disease-burden.Rmd" "9deead362349c98be8f1d9380a7b975a" "site/built/disease-burden.md" "2025-11-22"
1414
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2025-11-22"
1515
"learners/BF_measles.Rmd" "5725a25d664730bbce3736a3243c2182" "site/built/BF_measles.md" "2025-11-22"
1616
"learners/reference.md" "9e836f1ec999f95f55135cdd2c78d2e6" "site/built/reference.md" "2025-11-22"
17-
"learners/setup.md" "ba4314eaa33c1a26c7005999ae684326" "site/built/setup.md" "2025-11-22"
17+
"learners/setup.md" "be1de7ec41f52f14d00bcb74e87b5046" "site/built/setup.md" "2025-11-22"
1818
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2025-11-22"
1919
"renv/profiles/lesson-requirements/renv.lock" "ed8e13181a97cf165a5f5c51a40d9879" "site/built/renv.lock" "2025-11-22"

modelling-interventions.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,24 @@ exercises: 30 # exercise time in minutes
2525
Learners should also familiarise themselves with following concept dependencies before working through this tutorial:
2626

2727
**Outbreak response** : [Intervention types](https://www.cdc.gov/nonpharmaceutical-interventions/).
28+
29+
**R packages installed**: `{epidemics}`, `{socialmixr}`, `{scales}`, `{tidyverse}`.
30+
2831
:::::::::::::::::::::::::::::::::
2932

33+
:::::::::: spoiler
34+
35+
Install packages if their are not already installed
36+
37+
```r
38+
if (!base::require("pak")) install.packages("pak")
39+
pak::pak(c("epiverse-trace/epidemics", "socialmixr", "scales", "tidyverse"))
40+
```
41+
42+
If you have any error message,
43+
go to the [main setup page](../learners/setup.md#software-setup).
44+
45+
::::::::::
3046

3147
## Introduction
3248

@@ -50,7 +66,17 @@ In this tutorial different types of intervention and how they can be modelled ar
5066

5167
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
5268

53-
## A baseline model
69+
:::::::::::::::::::::: instructor
70+
71+
Share with learners the code for the baseline model.
72+
73+
It has **different** disease parameters than previous episode.
74+
75+
Then start with the livecoding directly with interventions.
76+
77+
::::::::::::::::::::::
78+
79+
## Baseline model
5480

5581
We will investigate the effect of interventions on a COVID-19 outbreak using an SEIR model (`model_default()` in the R package `{epidemics}`). To be able to see the effect of our intervention, we will run a baseline variant of the model, i.e, without intervention.
5682

@@ -127,6 +153,18 @@ output_baseline <- epidemics::model_default(
127153
)
128154
```
129155

156+
:::::::::::::::::::::: instructor
157+
158+
Make a pause.
159+
160+
Use slides to introduce the topics of:
161+
162+
- Non pharmaceutical interventions.
163+
164+
Then continue with the livecoding.
165+
166+
::::::::::::::::::::::
167+
130168
## Non-pharmaceutical interventions
131169

132170
[Non-pharmaceutical interventions](../learners/reference.md#NPIs) (NPIs) are measures put in place to reduce transmission that do not include the administration of drugs or vaccinations. NPIs aim at reducing contacts between infectious and susceptible individuals by closure of schools and workplaces, and other measures to prevent the spread of the disease, for example, washing hands and wearing masks.
@@ -146,7 +184,7 @@ rownames(cm_matrix)
146184
[1] "[0,15)" "[15,65)" "65+"
147185
```
148186

149-
Therefore, we specify ` reduction = matrix(c(0.5, 0.01, 0.01))`. We assume that the school closures start on day 50 and continue to be in place for a further 100 days. Therefore our intervention object is:
187+
Therefore, we specify `reduction = matrix(c(0.5, 0.01, 0.01))`. We assume that the school closures start on day 50 and continue to be in place for a further 100 days. Therefore our intervention object is:
150188

151189

152190
``` r
@@ -255,7 +293,7 @@ We can also model the effect of other NPIs by reducing the value of the relevant
255293

256294
We expect that mask wearing will reduce an individual's infectiousness, based on multiple studies showing the effectiveness of masks in reducing transmission. As we are using a population-based model, we cannot make changes to individual behavior and so assume that the transmission rate $\beta$ is reduced by a proportion due to mask wearing in the population. We specify this proportion, $\theta$ as product of the proportion wearing masks multiplied by the proportion reduction in transmission rate (adapted from [Li et al. 2020](https://doi.org/10.1371/journal.pone.0237691)).
257295

258-
We create an intervention object with `type = rate` and `reduction = 0.161`. Using parameters adapted from [Li et al. 2020](https://doi.org/10.1371/journal.pone.0237691) we have proportion wearing masks = coverage $\times$ availability = $0.54 \times 0.525 = 0.2835$ and proportion reduction in transmission rate = $0.575$. Therefore, $\theta = 0.2835 \times 0.575 = 0.163$. We assume that the mask wearing mandate starts at day 40 and continue to be in place for 200 days.
296+
We create an intervention object with `type = "rate"` and `reduction = 0.161`. Using parameters adapted from [Li et al. 2020](https://doi.org/10.1371/journal.pone.0237691) we have proportion wearing masks = coverage $\times$ availability = $0.54 \times 0.525 = 0.2835$ and proportion reduction in transmission rate = $0.575$. Therefore, $\theta = 0.2835 \times 0.575 = 0.163$. We assume that the mask wearing mandate starts at day 40 and continue to be in place for 200 days.
259297

260298

261299
``` r
@@ -336,6 +374,17 @@ To implement both contact and rate interventions in the same simulation they mus
336374

337375
::::::::::::::::::::::::::::::::::::::::::::::::
338376

377+
:::::::::::::::::::::: instructor
378+
379+
Make a pause.
380+
381+
Use slides to introduce the topics of:
382+
383+
- Pharmaceutical interventions.
384+
385+
Then continue with the livecoding.
386+
387+
::::::::::::::::::::::
339388

340389
## Pharmaceutical interventions
341390

@@ -358,6 +407,7 @@ $$
358407
\frac{dV_i}{dt} & =\nu_{i,t} S_i\\
359408
\end{aligned}
360409
$$
410+
361411
Individuals in age group ($i$) at specific time dependent ($t$) are vaccinated at rate ($\nu_{i,t}$). The other SEIR components of these equations are described in the tutorial [simulating transmission](../episodes/simulating-transmission.md#simulating-disease-spread).
362412

363413
To explore the effect of vaccination we need to create a vaccination object to pass as an input into `model_default()` that includes age groups specific vaccination rate `nu` and age groups specific start and end times of the vaccination program (`time_begin` and `time_end`).
@@ -494,6 +544,15 @@ To get an age-stratified plot, keep the default `by_group = TRUE` and then add `
494544

495545
:::::::::::::::::::::
496546

547+
:::::::::::::::::::::: instructor
548+
549+
Stop the livecoding.
550+
551+
Suggest learners to read the next episode.
552+
553+
Return to slides.
554+
555+
::::::::::::::::::::::
497556

498557
## Summary
499558

0 commit comments

Comments
 (0)