Skip to content

Repository files navigation

Scottish Index of Multiple Deprivation (SIMD) Shiny App - Exploring SIMD

An interactive RShiny application for exploring the Scottish Index of Multiple Deprivation (SIMD), originally developed in 2017 during a Q-Step internship at the University of Glasgow under the supervision of Dr. Brian Fogarty and Dr. Niccole Pamphilis. It has been substantially updated in 2026 with a new dataset, redesigned interface and expanded functionality.


Background

This was one of my first RShiny projects, originally built in 2017 as part of the Q-Step Programme at the School of Social and Political Sciences of University of Glasgow, a national initiative promoting quantitative methods training in the social sciences. The app was used by Q-step colleagues in public lectures to help general audiences understand statistical concepts and data visualisation through a real, policy-relevant dataset. It was also to guide the public through exploring deprivation patterns across Scotland interactively and to inspire younger generations in Glasgow City to study quantitative methods in the social sciences.

The Scottish Index of Multiple Deprivation (SIMD) is the Scottish Government's official tool for identifying areas of concentrated deprivation across the country, combining multiple domains including income, employment, health, education, housing, crime, and geographic access. Full details on the dataset are available from the Scottish Government.


What's New in the 2026 Update

  • SIMD 2020 dataset added alongside the original 2016 release, enabling direct comparison between the two most recent SIMD releases
  • Scotland-wide interactive mapping — previously limited to Glasgow City Council area, the map now covers the whole of Scotland using Local Authority Districts (2016 and 2020 boundaries respectively)
  • Redesigned interface using the Bootswatch "Minty" theme for a more polished, modern user experience
  • Improved variable descriptions for clearer, more accessible interpretation of SIMD domains and indicators
  • Expanded visualisation options for both single-variable and two-variable comparisons
  • Downloadable outputs for for original data sets, summary tables and any plot on the app
  • Interactive hover tooltips for the scatterplot and hexin views allowing to identify daa zones and council areas as you explore
  • Statistical indicator comparisons on the map tab with a Welch's two-sample t-tests for the selected indicator comparing 2016 and 2020 datasets
  • Google Analytics (GA4) integration to understand usage patterns and guide future development, with a transparent in-app privacy notice and privacy-conscious configuration (see Analytics & Privacy section below)

Features

📋 Information

Overview of the SIMD dataset, its domains and how to use the app's features.

📊 Single Variable Exploration

Summary statistics and customisable visualisation of individual SIMD variables, including:

  • Histogram
  • Density plot
  • Boxplot
  • Smmary statistics table for selected indicator
  • Optional data zones ranks for selected indicator

🔀 Two Variable Comparison

Explore relationships between pairs of SIMD variables through:

  • Geographic subsetting by local authority area (e.g. Greater Glasgow, Stirling, Edinburgh, Aberdeen, etc.)
  • Scatterplot
  • Optional (simple) linear regression model for scatterplot
  • Hexbin (density) chart, including third color by variable
  • Hover tooltip on both views with information regarding data zone and Council area as you explore the data

🗺️ Interactive Map

  • Scotland-wide choropleth map using Local Authority District boundaries (2016 / 2020)
  • Dedicated high-resolution Glasgow City Council map, built from a custom GeoJSON file created in QGIS
  • User-adjustable variable selection, colour schemes, and cartographic styling (map layers)
  • Welch's two-sample t-tests for the selected indicator comparing 2016 and 2020 datasets

Note on map density: Some rural areas with low population density may appear visually sparse on the Scotland-wide map at default zoom. Zoom in for more clearly defined data zones.


Data Sources

Dataset Description Source
SIMD16_Data.xlsx SIMD 2016 release, indicator-level data Scottish Government
SIMD20_Data.xlsx SIMD 2020 release, indicator-level data Scottish Government
SG_SIMD_2016_1.geojson Custom Glasgow City Council boundary file Created in QGIS
data_simdGla.csv Processed Glasgow-level dataset Derived from SIMD source data

Full SIMD documentation and methodology available at gov.scot/Topics/Statistics/SIMD.


Repository Structure

SIMD-Shiny-App/
│
├── .github/
|    workflows/
│      └──r-check.yml       # Checks syntax, lint (coding conventions) & UI/Server matching
├── www/
│   ├── Q_Step_logo.png     # Q-Step Programme logo
│   └── UofG_logo.jpeg      # University of Glasgow logo
|
├── App.R                   # Main Shiny application (UI and server)
├── ShinySIMD.Rproj         # RStudio project file
│
├── SIMD16_Data.xlsx        # SIMD 2016 dataset
├── SIMD20_Data.xlsx        # SIMD 2020 dataset
├── SG_SIMD_2016_1.geojson  # Custom Glasgow boundary file (QGIS-derived)
├── data_simdGla.csv        # Processed Glasgow-level data
│
├── UI_Server-check.R       # Rscript to check all UI inputs have corresponding Server outputs
│
├── .gitignore
├── README.md
└── LICENSE

Tools & Dependencies

install.packages(c(
  "shiny", "bslib", "shinyFeedback",
  "tidyverse", "DT", "ineq", "readxl", 
  "sf", "leaflet", "RColorBrewer", "ggpubr"
))
Package Purpose
shiny Core application framework
bslib UI theming and layout (page_navbar, Bootswatch "lux" theme, Google Fonts)
shinyFeedback Inline validation warnings (e.g. flagging when a variable isn't available in both SIMD datasets)
tidyverse Data manipulation (dplyr) and all visualisations (ggplot2)
DT Interactive summary statistics table
ineq Gini coefficient calculation for inequality measures
readxl Reading SIMD source data from Excel workbooks
sf Spatial data handling for the Scotland boundary GeoJSON
leaflet Interactive choropleth map
RColorBrewer Colour palettes for the map's colour scheme selector
ggpubr Pearson correlation annotation on scatterplots

Note: The original script also loaded gridExtra, grid, data.table, scales, lattice, magrittr, stats, haven, Hmisc, rgdal, sp, raster, rsconnect, shinythemes, fresh, png, and shinydashboard. These have been removed following a dependency audit as part of the 2026 rewrite. rgdal in particular was retired from CRAN in October 2023 and is replaced by sf throughout. rsconnect is only needed for deployment and should be installed separately in your deployment environment rather than loaded within App.R itself.


Maintenance Notes

As part of the 2026 update, the codebase underwent a full audit and refactor:

  • Dependency audit — reduced from 21 loaded libraries to 11 actively used ones, removing unused and deprecated packages (see Tools & Dependencies below)
  • Bug fixes — resolved several issues including a non-functional interactive map tab, broken theme-switching logic and fragile variable-selection code
  • Code deduplication — refactored repeated dataset-selection and variable-update logic into shared helper functions, reducing the codebase by roughly 30% while preserving all functionality
  • Deprecated package migration — replaced rgdal (retired from CRAN, October 2023) with sf throughout
  • Github Actions — created various actions for syntax and lint checking and UI/Server consistency, improving workflow
  • Google Analytics (GA4) integration to understand usage patterns and guide future development (see more info Data Analytics & Privacy section)

How to Run Locally

  1. Clone the repository
  2. Open ShinySIMD.Rproj in RStudio
  3. Ensure all data files (SIMD16_Data.xlsx, SIMD20_Data.xlsx, SG_SIMD_2016_1.geojson, data_simdGla.csv) are in the root directory
  4. Run the app:
shiny::runApp()

Acknowledgements

Originally developed during a Q-Step Programme internship at the School of Social and Political Sciences of University of Glasgow (2017) under the supervision of Dr. Brian Fogarty and Dr. Niccole Pamphilis. The Q-Step Programme is a national initiative promoting quantitative social science training, supported by the Nuffield Foundation, Economic and Social Research Council (ESRC) and the Higher Education Funding Council for England (HEFCE).


Data Analytics & Privacy

This app uses Google Analytics (GA4) to understand usage patterns such as which features are explored, which datasets are downloaded and approximate visitor geography at country-level only. This data informs ongoing development priorities and is periodically summarised for reporting purposes only. Data collection practices described here apply equally to all visitors, in line with UK GDPR and EU GDPR principles. For more information see UK's data protection here and the EU's GDPR full text here.

What is collected:

  • Anonymous page/tab views
  • Feature interaction events (e.g. dataset or table downloads)
  • Approximate country-level location (derived from network/browser data, not precise location or IP address)

What is NOT collected:

  • Any personally identifiable information (name, email, etc.)
  • Precise location or IP addresses
  • Cross-device or advertising-related tracking (Google Signals is disabled for this property)

Data retention:

  • The analytics data mentioned is retained for a maximum of 2 months before automatic deletion.

For full detail on how Google collects and processes analytics data, see Google's Privacy Policy.

This app does not use cookies for any purpose beyond the anonymous analytics described above and does not sell or share data with third parties.

Note: This statement reflects good-faith transparency about data practices for a personal academic project. It does not constitute formal legal advice or a guarantee of regulatory compliance.


Author

Dr. Cristina Chueca Del Cerro
Portfolio

Questions, suggestions or collaboration ideas are always welcome so get in touch!


About

Interactive RShiny dashboard application for exploring the Scottish Index of Multiple Deprivation (SIMD) through summary statistics, bivariate plots and a map of Scotland

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages