sae4health

R Shiny App for Small Area Estimation of Health and Demographic Indicators

https://github.com/wu-thomas/sae4health

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

R Shiny App for Small Area Estimation of Health and Demographic Indicators

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# sae4health


[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/sae4health)](https://cran.r-project.org/package=sae4health) [![](https://cranlogs.r-pkg.org/badges/sae4health)](https://cran.r-project.org/package=sae4health) 
[![](https://cranlogs.r-pkg.org/badges/grand-total/sae4health?color=orange)](https://cran.r-project.org/package=sae4health)


Small Area Estimation for Key Health and Demographic Indicators from Household Surveys

## Overview

The 'sae4health' package enables small area estimation (SAE) of health and demographic indicators in low- and middle-income countries (LMICs). It powers an R Shiny app that helps public health analysts, policymakers, and researchers generate subnational estimates and prevalence maps for 150+ binary indicators from Demographic and Health Surveys (DHS). Basing its core SAE analysis workflow on the 'surveyPrev' package, the app ensures methodological rigor through guided model selection, automated fitting, and interactive visualization. For more details, visit our [official website](https://wu-thomas.github.io/surveyPrev_website/){target="_blank"} for detailed documentation. 

This software is for research purpose only and is licensed under the terms specified in the [LICENSE file](https://github.com/wu-thomas/sae4health/blob/main/LICENSE.md).  

The Github repo maintains the source code for this R Shiny application and it is structured as an R package. There are two primary venues to utilize this application:

1. **Web-Based Version**:

* Location: Deployed on an online server.
* Requirements: Internet access and a web browser.
* Usage: Ideal for users who prefer quick access without local setup.

2. **Local R Package Installation**:

* Location: on user's machine, launched by RStudio. 
* Requirements: R environment and dependent packages.
* Usage: Suitable for users who wish to run the application directly within their local R environment. This method allows for enhanced customization.


## Web-based R Shiny app

The R Shiny app is readily accessible via [https://rsc.stat.washington.edu/surveyPrevRShiny/](https://rsc.stat.washington.edu/surveyPrevRShiny/). The only requirement is a stable internet connection. This web-based deployment supports full functionality and serves as the primary distribution channel.

One advantage of the online version is that it includes preloaded shapefiles, reducing the need for manual uploads. While all versions require users to upload their own DHS survey datasets for analysis, currently the online version internally hosts the 2018 Nigeria DHS, 2022 Kenya DHS, and 2023 Senegal DHS (**without the need for data upload!**), with more datasets planned for future inclusion.  


## Installation of the R Shiny app as a R package

Some non-CRAN dependencies can be installed using the following command. We strongly recommend installing the most recent version of SUMMER and surveyPrev package from Github. 

``` {r, eval=F, echo=T}
# install.packages("devtools")
devtools::install_github("richardli/SUMMER")
devtools::install_github("richardli/surveyPrev")

install.packages("INLA",repos=c(getOption("repos"),
                        INLA="https://inla.r-inla-download.org/R/testing"),dep=TRUE)

```






``` {r, eval=F, echo=F}

install_missing_packages <- function(packages) {
  missing_packages <- packages[!(packages %in% installed.packages()[, "Package"])]
  
  if (length(missing_packages) > 0) {
    message("Installing missing packages: ", paste(missing_packages, collapse = ", "))
    install.packages(missing_packages, dependencies = TRUE)
  } else {
    message("All packages are already installed.")
  }
}

# List of required packages
required_packages <- c(
  "geodata",      # Handle GADM shapefiles  
  "bookdown",     # Display mathematical formulas  
  "markdown",     # Render Markdown documents  
  "data.table",   # Efficient data manipulation  
  "tidyr",        # Data tidying and reshaping  
  "labelled",     # Manage labels in DHS data  
  "naniar",       # Handle missing data  
  "haven",        # Read and write SPSS, Stata, and SAS data  
  "sjlabelled",   # Work with labeled survey data (DHS, etc.)  
  "ggridges",     # Create ridge plots  
  "ggthemes",     # Predefined themes for ggplot2  
  "RColorBrewer", # Color palettes for visualizations  
  "viridisLite",  # Alternative color scales for ggplot2  
  "scales",       # Format and scale axes/legends  
  "patchwork",    # Combine multiple ggplots  
  "leaflegend",   # Add legends to Leaflet maps  
  "leafsync",     # Synchronize multiple Leaflet maps  
  "plotly",       # Create interactive scatter plots  
  "readr"         # Read tabular data efficiently  
)

# Run the function to install any missing packages
install_missing_packages(required_packages)

```







You can then install the development version of sae4health with:

``` {r, eval=F, echo=T}
devtools::install_github("wu-thomas/sae4health")
```







Processing the analysis dataset for indicators, using specific coding schemes and handling labels, requires the following libraries to be **preloaded** before running the app:  

```{r, eval=F, echo=T}
library(labelled)
library(naniar)
library(sjlabelled)
library(dplyr)
library(data.table)
library(haven)

```


You can launch the R Shiny app with the following command, and we recommend opening a new browser tab from within the launched R Shiny app for better accessing web links.

```{r, eval=F, echo=T}

library(sae4health)
sae4health::run_app()

```


If the colors in the interactive Leaflet maps appear inverted relative to the legend (e.g., regions with high values in the legend are shown in low-value colors), you can run the app with the following option. This issue arises due to differences in R and Leaflet package versions and is beyond our control.

```{r, eval=F, echo=T}

sae4health::run_app(legend_color_reverse=T)

```

For WHO workshop attendees only:  
If you have received the WHO shapefile distributed by WHO officials for this technical workshop and are using the WHO version of the app, please run the following version:

```{r, eval=F, echo=T}

sae4health::run_app(version='DHS-WHO')

```





























































Owner

  • Login: wu-thomas
  • Kind: user

GitHub Events

Total
  • Member event: 1
  • Push event: 9
  • Fork event: 1
  • Create event: 2
Last Year
  • Member event: 1
  • Push event: 9
  • Fork event: 1
  • Create event: 2

Packages

  • Total packages: 1
  • Total downloads:
    • cran 566 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: sae4health

Small Area Estimation for Key Health and Demographic Indicators from Household Surveys

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 566 Last month
Rankings
Dependent packages count: 26.9%
Forks count: 29.0%
Dependent repos count: 33.2%
Stargazers count: 37.2%
Average: 42.7%
Downloads: 87.0%
Maintainers (1)
Last synced: 11 months ago