Skip to content

Commit 044b9f1

Browse files
committed
Adding vignettes
1 parent c023d74 commit 044b9f1

File tree

4 files changed

+157
-0
lines changed

4 files changed

+157
-0
lines changed

.DS_Store

2 KB
Binary file not shown.

vignettes/.DS_Store

6 KB
Binary file not shown.

vignettes/getting_started.Rmd

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: "Getting started with epiworldRShiny"
3+
author:
4+
- Derek Meyer
5+
- George Vega Yon
6+
date: "`r Sys.Date()`"
7+
output: rmarkdown::html_vignette
8+
vignette: >
9+
%\VignetteIndexEntry{Getting started with epiworldRShiny}
10+
%\VignetteEngine{knitr::rmarkdown}
11+
%\VignetteEncoding{UTF-8}
12+
---
13+
14+
```{r setup, include = FALSE}
15+
knitr::opts_chunk$set(
16+
collapse = TRUE,
17+
comment = "#>", out.width = "80%", fig.width = 7, fig.height = 5,
18+
fig.align = "center"
19+
)
20+
```
21+
22+
Welcome to epiworldRShiny, a powerful Shiny app designed to enhance the functionality of the epiworldR package for simulating agent-based models. The package offers a user-friendly interface that enables users to simulate infectious diseases using nine different epidemiological models. With epiworldRShiny, incorporating various interventions such as vaccines, masking, and school closures into your simulations can be done with ease. The package also provides intuitive visualization tools to help interpret and analyze simulation results. Whether you're a researcher, healthcare professional, or student, epiworldRShiny simplifies the process of simulating and understanding the dynamics of infectious diseases.
23+
24+
# Example 1: Simulating a SEIR Network Model
25+
26+
## Running the application
27+
28+
In order to run the epiworldRShiny application, first ensure that the package is
29+
installed and loaded using the following code. To launch the application,
30+
use call the function, epiworldRShiny().
31+
```{r running-the-app}
32+
# install.packages("epiworldRShiny")
33+
library(epiworldRShiny)
34+
# epiworldRShiny()
35+
```
36+
37+
## Model set-up
38+
39+
After launching the application, notice the sidebar contains many disease and model parameters which can be modified. Altering these parameters will affect the spread of the infectious disease in the simulated population. Name the disease
40+
of interest, specify the parameters of choice (listed below), and select "run simulation".
41+
42+
- **Model**: Network SEIR
43+
- **Disease**: COVID-19
44+
- **% of population infected** = 0.1
45+
- **Probability of exposure** = 0.05
46+
- **Recovery probability** = 0.14
47+
- **Incubation days** = 7
48+
- **Simulation time** = 100
49+
- **Seed** = 2023
50+
51+
## Running the model
52+
```{r, echo=FALSE}
53+
knitr::include_graphics("https://github.com/UofUEpiBio/epiworldRShiny/assets/105825983/f4e7d313-e3b6-4ebb-9c0a-ca4d53ef9cea")
54+
```
55+
56+
The above graphic demonstrates launching the application and running the model with COVID-19 as the disease. After running the simulation, plots of the distributions of states and the disease's reproductive number over time, a model summary, and table of each state's counts over time are all displayed.
57+
58+
## Results
59+
60+
In this example, the model of choice is a SEIR Network model. Notice the day of peak infections occurs on day 12, maxing at about 18,000 infections. After roughly 40 days, the state's curves taper off, meaning that the majority of the population has recovered from the disease. The reproductive number plot demonstrates that the disease spread rapidly at the beginning of the simulation, and drastically decreased over the first 10 days. The model summary returns important information about the simulation such as the model choice, population size, simulation speed, disease(s) present, any tool(s) present, and model parameters. The distribution table displays the counts for each state at baseline and conclusion. The transition probabilities table displays the probability of moving between states. For example, the probability that a susceptible agent remains in the susceptible state is 0.62, with a probability of moving to the exposed state 0.38. Lastly, the counts table shows the state's counts over time, marking the peak infection count in bold font.
61+

vignettes/interventions.Rmd

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: "Implementing Interventions with epiworldRShiny"
3+
author:
4+
- Derek Meyer
5+
- George Vega Yon
6+
date: "`r Sys.Date()`"
7+
output: rmarkdown::html_vignette
8+
vignette: >
9+
%\VignetteIndexEntry{Getting started with epiworldRShiny}
10+
%\VignetteEngine{knitr::rmarkdown}
11+
%\VignetteEncoding{UTF-8}
12+
---
13+
14+
```{r setup, include = FALSE}
15+
knitr::opts_chunk$set(
16+
collapse = TRUE,
17+
comment = "#>", out.width = "80%", fig.width = 7, fig.height = 5,
18+
fig.align = "center"
19+
)
20+
```
21+
22+
# Example 2: Implementing vaccine and school closure
23+
24+
## Running the application
25+
To run the epiworldRShiny application, first ensure that the package is
26+
installed and loaded using the following code. To launch the application,
27+
use call the function, epiworldRShiny().
28+
```{r running-the-app}
29+
# install.packages("epiworldRShiny")
30+
library(epiworldRShiny)
31+
# epiworldRShiny()
32+
```
33+
34+
## Model set-up
35+
36+
This example features the implementation of the vaccine and school closure
37+
interventions to curb disease spread. All model output can be interpreted using
38+
the same logic from example #1.
39+
40+
- **Model**: network SEIRD
41+
- **Disease**: COVID-19
42+
- **% of population infected** = 0.1
43+
- **Probability of exposure** = 0.05
44+
- **Recovery probability** = 0.14
45+
- **Incubation days** = 7
46+
- **Simulation time** = 100
47+
- **Vaccine prevalence** = 70%
48+
- **School closure prevalance** = 50%
49+
- **Day of school closure implementation** = 7
50+
- **Seed** = 2023
51+
52+
## Running the model
53+
```{r, echo=FALSE}
54+
knitr::include_graphics("https://github.com/UofUEpiBio/epiworldRShiny/assets/105825983/d5405162-f7fe-4a42-8a4c-e9a2ac31be73")
55+
```
56+
57+
The above graphic demonstrates launching the application and running the model
58+
with COVID-19 as the disease. To modify the intervention parameters, scroll to
59+
the bottom of the application sidebar, select "interventions", and modify as
60+
desired. After running the simulation, plots of the distributions of states and
61+
the disease's reproductive number over time, a model summary, and table of each
62+
state's counts over time are all displayed.
63+
64+
## Results
65+
66+
In this example, the model of choice is a SEIRD Network model. Notice the day of
67+
peak infections occurs on day 12, maxing out at 3,882 infections. Notice in
68+
the SEIRD model plot, there are very few exposed, infected, and deceased agents
69+
while the number of susceptible and recovered agents over the course of the
70+
simulation changes rapidly. Due to the vaccine, which decreases the probability
71+
of infection, and school closures which decrease the probability of exposure to
72+
COVID-19, there are a significantly decreased number of exposed, infected, and
73+
deceased agents.
74+
75+
## Comparison to absence of interventions
76+
77+
```{r, echo=FALSE, fig.show='hold',fig.align='center'}
78+
# library(cowplot)
79+
# library(magick)
80+
# ggdraw() +
81+
# draw_image("~/Desktop/intervention.png", width = 0.5) +
82+
# draw_image("~/Desktop/comparison_plot.png", width = 0.5, x = .5)
83+
84+
knitr::include_graphics("~/Desktop/Research/comparison.png")
85+
86+
```
87+
88+
The above SEIRD model figures demonstrate the distribution of states over time
89+
both with and without interventions present (left and right figures
90+
respectively). With no measure to combat the spread of COVID-19, the number of
91+
exposed, infected, and deceased individuals greatly increase compared to the
92+
model with interventions. The peak number of infections occurs earlier, on day
93+
11, with a total of 17,616 infections at the peak, compared to 3,882 infections
94+
on day 12 with interventions present. This indicates that the vaccination and
95+
school closing measures were effective in reducing the number of infections and
96+
deaths in this simulated population.

0 commit comments

Comments
 (0)