MBGapp

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.

Features

Workflow

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

Installation

Install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("olatunjijohnson/MBGapp", ref = "main")

Then launch the app:

library(MBGapp)
run_app()

Run without installing

shiny::runGitHub(
  repo     = "MBGapp",
  username = "olatunjijohnson",
  ref      = "main",
  subdir   = "inst/MBGapp"
)

Online version

Access the app directly in your browser — no R installation needed:

https://olatunjijohnson.shinyapps.io/mbgapp/

Example data

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:

Dependencies

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).

Authors

Olatunji Johnson, Claudio Fronterre, Emanuele Giorgi CHICAS, Lancaster Medical School, Lancaster University