Provides an interactive 'shiny' application for teaching and applied analysis of geostatistical data. Users can explore spatial data, assess spatial correlation through the empirical variogram, fit model-based geostatistical models for continuous, prevalence and count outcomes, produce spatial predictions, and download reports. The methodology follows the model-based geostatistics framework of Diggle and Giorgi (2019, ISBN:9781138732353).
MBGapp is an interactive Shiny application for teaching and practising model-based geostatistics (MBG). It guides users through the complete spatial analysis workflow — data exploration, variogram fitting, model estimation, and spatial prediction — without requiring any coding.
| Tab | What you do |
|---|---|
| Explore | Upload data, choose data type, inspect the spatial distribution on an interactive map and scatter plots |
| Variogram | Examine spatial correlation structure; fit theoretical variogram models |
| Estimation | Fit a geostatistical model; view parameter estimates and 95% confidence intervals |
| Prediction | Map the predicted surface over the study region |
| Report | Download a PDF report of selected outputs |
Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("olatunjijohnson/MBGapp", ref = "main")
Then launch the app:
library(MBGapp)
run_app()
shiny::runGitHub(
repo = "MBGapp",
username = "olatunjijohnson",
ref = "main",
subdir = "inst/MBGapp"
)
Access the app directly in your browser — no R installation needed:
https://olatunjijohnson.shinyapps.io/mbgapp/
The package ships with the Loa loa prevalence survey dataset from
Cameroon (columns: Longitude, Latitude, Positive, Examined). A
10 km prediction grid and covariate rasters for Cameroon are also
included.
Additional example files can be downloaded from Google Drive:
MBGapp uses the following R packages:
shiny, shinyjs, sf, terra, leaflet, leafem, tidyterra,
stars, ggplot2, dplyr, readr, tidyr, magrittr, splines,
geoR, RiskMap (MCMC
backend), and optionally INLA (fast Bayes
backend).
Olatunji Johnson, Claudio Fronterre, Emanuele Giorgi CHICAS, Lancaster Medical School, Lancaster University