The Dengue FOI and Model Analysis Shiny application is designed to analyze the Force of Infection (FOI) and epidemiological models for dengue cases across selected provinces and districts in Sri Lanka.
It allows users to:
- Upload datasets
- Filter by province and year
- Run statistical models (either time-constant or time-varying analysis)
- Generate interactive plots and metrics for analysis
- Open RStudio and the file
ShinyApp.R. Ensure the following packages have been installed and otherwise run: install.packages("shiny", "ggplot2", "ggpubr", "rstan", "dplyr", "tidyr", "reshape2", "writexl")) - Set the working directory to the ShinyApp folder.
- Highlight the entire code and run it.
- The ShinyApp window will appear automatically.
-
File Inputs: Requires two CSV files:
- Dengue cases (simulated)
- Population data
Columns should include province, district, year, and age group.
-
Province and Year Selection:
- Dropdown for province selection
- Slider for year range
-
Select Reference Age-group: the app uses the reference age-group to estimate age modifiers for the reporting of groups younger (χ1) and older (χ2) than the reference.
-
Models Available:
time_constant.stan: FOI assumed constant across timetime_varying.stan: Year-specific FOI estimates
-
Iterations:
- Slider to select number of iterations
- Increase iterations if the model does not converge (e.g., Rhat > 1.1 or poor chain convergence).
-
Run Model:
- Click Run Model to start.
- Progress bar shows model fitting stages.
- Results appear once complete.
- Errors with convergence will appear in red.
-
Fit Plot:
- Observed vs predicted incidence by year, age group, and location
- Median (blue line) with 95% credible intervals (blue shaded area)
-
FOI (Lambda) Plot:
- Historical FOI (Lam_H)
- Time-varying FOI (for
time_varying.stan) - 95% credible intervals
-
Parameter (Pars) Plot:
- Province-specific parameters (rho, gamma, chi1, chi2)
- Median with 95% credible intervals
-
Traceplot:
- MCMC chain diagnostics and convergence
-
Rhat Values Table:
- Summary of Rhat values to assess convergence
-
Model Feedback Tab:
- Real-time updates on model progress and potential issues
-
Excel Output Files:
- For
time_constant.stan: one Excel file with posterior parameter estimates - For
time_varying.stan: two Excel files with posterior parameter estimates - Files are automatically saved in the working folder and include summaries of the posterior distributions
- For