You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: episodes/modelling-interventions.Rmd
+41-2Lines changed: 41 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -378,7 +378,7 @@ vaccinate <- vaccination(
378
378
)
379
379
```
380
380
381
-
We pass our vaccination object into the model using argument `vaccination = vaccinate`:
381
+
We pass our vaccination object into the model using the argument `vaccination = vaccinate`:
382
382
383
383
```{r output_vaccinate}
384
384
output_vaccinate <- model_default(
@@ -434,12 +434,51 @@ output %>%
434
434
)
435
435
```
436
436
437
-
From the plot we see that the peak number of total number of infectious individuals when vaccination is in place is much lower compared to school closures and maskwearing interventions.
437
+
From the plot, we see that the peak number of total number of infectious individuals when vaccination is in place is much lower compared to school closures and mask-wearing interventions.
438
438
439
439
:::::::::::::::::::::::::::::::::
440
440
::::::::::::::::::::::::::::::::::::::::::::::::
441
441
442
+
Lastly, if you are interested in plotting the trajectory of new infections from an `epidemics::model_default()` with a `vaccination` intervention, you need to specify one additional argument.
443
+
At `epidemics::new_infections()` specify `compartments_from_susceptible = "vaccinated"` to name the model compartments into which individuals transition from the "susceptible" compartment, and which are not related to infection. In the scenario above, "vaccinated" individuals who are no longer susceptible should not be counted as infected.
442
444
445
+
::::::::::::::::::::: spoiler
446
+
447
+
Notice that if we use `by_group = FALSE` in `epidemics::new_infections()`, we get a summary of the new infections in all demographic groups.
448
+
Try keeping the default `by_group = TRUE` and adding `linetype = demography_group` when declaring variables in `ggplot(aes(...))`.
449
+
450
+
```{r}
451
+
infections_baseline <- epidemics::new_infections(
452
+
data = output_baseline,
453
+
compartments_from_susceptible = "vaccinated", # if vaccination
0 commit comments