Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions episodes/modelling-interventions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ From the plot, we see that the peak number of total number of infectious individ
::::::::::::::::::::::::::::::::::::::::::::::::

Lastly, if you want to plot new infections from an `epidemics::model_default()` that includes a `vaccination` intervention, you need to add one argument to `epidemics::new_infections()`:
Set `compartments_from_susceptible = "vaccinated"` to tell the function that people moving from "susceptible" to "vaccinated" are not becoming infected. This ensures vaccinated individuals aren't counted as infections.
Set `exclude_compartments = "vaccinated"` to tell the function that people moving from "susceptible" to "vaccinated" are not becoming infected. This ensures vaccinated individuals aren't counted as infections.

::::::::::::::::::::: spoiler

Expand All @@ -449,13 +449,13 @@ Note that if we add `by_group = FALSE` in `epidemics::new_infections()`, we get
```{r}
infections_baseline <- epidemics::new_infections(
data = output_baseline,
compartments_from_susceptible = "vaccinated", # if vaccination
exclude_compartments = "vaccinated", # if vaccination
by_group = FALSE
)

infections_intervention <- epidemics::new_infections(
data = output_vaccinate,
compartments_from_susceptible = "vaccinated", # if vaccination
exclude_compartments = "vaccinated", # if vaccination
by_group = FALSE
)

Expand Down
38 changes: 19 additions & 19 deletions episodes/vaccine-comparisons.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ To understand the **indirect** effect of vaccinations, we want to know the effec
The inputs required are :

+ `data` : the model output,
+ `compartments_from_susceptible` : this is an optional input, but in our case needed. We don't want the number of people vaccinated to be counted as new infections, so we need to specify the name of the model compartment where individuals transition out from `susceptible` (in this example `vaccinated`),
+ `exclude_compartments` : this is an optional input, but in our case needed. We don't want the number of people vaccinated to be counted as new infections, so we need to specify the name of the model compartment where individuals transition out from `susceptible` (in this example `vaccinated`),
+ `by_group` : should the results be calculated for each demographic group separately.


```{r}
vaccinate_01_infections <- epidemics::new_infections(
output_vaccinate_01,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
```
Expand All @@ -325,17 +325,17 @@ vaccinate_01_infections <- epidemics::new_infections(
# calculate new infections
baseline_infections <- epidemics::new_infections(
output_baseline,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_01_infections <- epidemics::new_infections(
output_vaccinate_01,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_02_infections <- epidemics::new_infections(
output_vaccinate_02,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)

Expand Down Expand Up @@ -385,17 +385,17 @@ infections %>%
# calculate new infections
baseline_infections <- epidemics::new_infections(
output_baseline,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_01_infections <- epidemics::new_infections(
output_vaccinate_01,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_02_infections <- epidemics::new_infections(
output_vaccinate_02,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)

Expand Down Expand Up @@ -578,17 +578,17 @@ output_vaccinate_group_3 <- epidemics::model_default(

vaccinate_group_1_infections <- epidemics::new_infections(
output_vaccinate_group_1,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_group_2_infections <- epidemics::new_infections(
output_vaccinate_group_2,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_group_3_infections <- epidemics::new_infections(
output_vaccinate_group_3,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)

Expand Down Expand Up @@ -702,17 +702,17 @@ output_vaccinate_group_3 <- epidemics::model_default(

vaccinate_group_1_infections <- epidemics::new_infections(
output_vaccinate_group_1,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_group_2_infections <- epidemics::new_infections(
output_vaccinate_group_2,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)
vaccinate_group_3_infections <- epidemics::new_infections(
output_vaccinate_group_3,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = FALSE
)

Expand Down Expand Up @@ -789,7 +789,7 @@ To convert infections to deaths, we will need new infections by age group, so we
```{r}
vaccinate_group_1_age <- epidemics::new_infections(
output_vaccinate_group_1,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = TRUE
)

Expand All @@ -808,7 +808,7 @@ vaccinate_group_1_deaths <-

vaccinate_01_age <- epidemics::new_infections(
output_vaccinate_01,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = TRUE
)

Expand All @@ -823,7 +823,7 @@ vaccinate_01_deaths <-

vaccinate_group_2_age <- epidemics::new_infections(
output_vaccinate_group_2,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = TRUE
)

Expand All @@ -838,7 +838,7 @@ vaccinate_group_2_deaths <-

vaccinate_group_3_age <- epidemics::new_infections(
output_vaccinate_group_3,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = TRUE
)

Expand All @@ -854,7 +854,7 @@ vaccinate_group_3_deaths <-

baseline_age <- epidemics::new_infections(
output_baseline,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = TRUE
)

Expand Down
2 changes: 1 addition & 1 deletion learners/BF_measles.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
recovery duration. Upon recovery, they gain lifelong immunity against
the current infection, meaning they do not become susceptible again, and
they move to the recovered class ($\mathbf{R}$) (see
[Figure 1](#fig-seir)). These are some assumptions for modelling purposes and

Check warning on line 40 in learners/BF_measles.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Figure 1](#fig-seir)
may not particularly reflect the biological underlying processes.

![](fig/t0.drawio.png){ref-parent="fig-seir"}

Check warning on line 43 in learners/BF_measles.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/t0.drawio.png
![](fig/t1.drawio.png){ref-parent="fig-seir"}

Check warning on line 44 in learners/BF_measles.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/t1.drawio.png
![](fig/t2.drawio.png){ref-parent="fig-seir"}

Check warning on line 45 in learners/BF_measles.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/t2.drawio.png
![](fig/t3.drawio.png){ref-parent="fig-seir"}

Check warning on line 46 in learners/BF_measles.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/t3.drawio.png

The four S-E-I-R classes considered in the $\mathbf{SEIR}$ model.
The number of individuals in each
Expand Down Expand Up @@ -568,7 +568,7 @@



::: {.alert .alert-secondary}

Check warning on line 571 in learners/BF_measles.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[unknown div] alert

### Question

Expand Down Expand Up @@ -769,7 +769,7 @@
# Load new infections data for each scenario
data_vaccine <- epidemics::new_infections(
output3,
compartments_from_susceptible = "vaccinated",
exclude_compartments = "vaccinated",
by_group = TRUE
)

Expand Down
Loading
Loading