Advanced Statistics and Machine Learning for Health Research

A Practical Course for Health Researchers

Authors

Mark Khurana

Neil Scheidwasser

Published

August 12, 2026

Welcome

This course teaches advanced statistics and machine learning to people who work in health research. It assumes you know the basics — means, standard deviations, maybe a t-test — and takes you from there to the methods you actually see in current medical journals: splines, penalised regression, prediction models, Bayesian analysis, and dimensionality reduction.

Everything uses clinical data. Every exercise works in R and Python. Pick one or try both. Each exercise has a worked solution you can reveal right beneath it (click Solution).

What you will learn

By the end of this course, you will be able to:

  • Model non-linear relationships properly instead of categorising continuous variables
  • Analyse time-to-event outcomes, clustered and longitudinal data, and datasets with missing values
  • Apply Bayesian methods including hierarchical models for multi-site studies
  • Use machine learning methods (random forests, gradient boosting, neural networks) and know when they help and when they do not
  • Explain what a model has learned, rather than treating it as a black box
  • Build, validate, and report clinical prediction models to current standards (TRIPOD+AI), judging them on calibration and clinical utility as well as discrimination
  • Reduce high-dimensional data with PCA, t-SNE, and UMAP, and find subgroups by clustering
  • Reason about causal questions in observational data, and synthesise evidence through meta-analysis

Structure

The course runs in seven parts, in this order:

Part Chapters What it covers
Pre-Course: Foundations 1–4 Environment setup, probability and distributions, statistical inference, regression refresher
Advanced Statistical Methods 5–9 Splines and non-linear modelling, penalised regression, survival analysis, mixed-effects models, missing data and multiple imputation
Bayesian Methods 10–11 Bayesian inference, then applied hierarchical models for multi-site studies
Supervised Learning 12–16 ML foundations, trees and ensembles, neural networks, model evaluation beyond accuracy, explainability
Applied Supervised Learning: Clinical Prediction Models 17–19 Developing models, performance assessment and validation (calibration, decision curves), reporting to TRIPOD+AI
Unsupervised Learning 20–21 Dimensionality reduction with PCA, t-SNE and UMAP; clustering
Causal Inference and Evidence Synthesis 22–24 Causal inference (DAGs, propensity scores, weighting, g-computation, target trial emulation), mediation analysis, meta-analysis

A few notes on how the parts fit together. The Pre-Course material should be completed before Day 1 if you are taking this in person; if you are self-studying, work through everything in order.

Bayesian Methods sits deliberately before the machine learning parts, because the ideas about priors and uncertainty it introduces recur throughout.

Calibration, decision curves, and validation live in Applied Supervised Learning, not in the general model-evaluation chapter — that chapter covers discrimination and threshold-based metrics, and the prediction-model part then takes evaluation considerably further.

Unsupervised Learning comes after the prediction-model chapters. It does not depend on them, so you can read it earlier if it is what you need.

Causal Inference and Evidence Synthesis is for after the course — use it when you are doing your own research and need to reason about cause rather than prediction, or to combine what other studies have already found.

Am I ready?

Skim Chapters 2–4 (probability, inference, and regression). If the material feels familiar, go straight to Chapter 5. If it feels new, work through those chapters carefully first — they are the foundation everything else builds on. Chapter 1 is environment setup and is worth doing regardless, since every later chapter assumes a working R and Python installation.

Datasets

All exercises use real or realistically simulated clinical data:

  • Framingham Heart Study — cardiovascular risk
  • Wisconsin Breast Cancer — diagnostic classification
  • PBC (Mayo Clinic) — liver disease survival
  • NHANES — national health survey
  • Simulated meningitis — based on Lopez-Ayala et al. (BMJ 2025)

Details in the Dataset Codebook.

Key sources

This course draws heavily on:

  • Smits, L. J. M., van Kuijk, S. M. J., & Wynants, L., Improving Health Care with Clinical Prediction Models (2026, CC BY 4.0)
  • Van Calster, B., et al., Lancet Digital Health (2025) — performance measures for prediction models
  • Lopez-Ayala, P., et al., BMJ (2025) — handling continuous variables and splines
  • Collins, G. S., et al., BMJ (2024) — TRIPOD+AI reporting guidelines
  • Harrell, F. E., Regression Modeling Strategies (2015)
  • McElreath, R., Statistical Rethinking (2020)

Full references appear at the bottom of each chapter.

Suggest an improvement

This course is actively maintained, and the most useful feedback we get comes from people working through it. Please tell us if you find:

  • code that does not run when you copy it into your own session — this is the single most valuable thing you can report, and please paste the error;
  • an explanation that assumes something it never established, or jargon we forgot to define;
  • a figure whose message is not clear from the figure itself;
  • a statistical claim you think is wrong, or a reference that does not support what we say it does;
  • a method you expected to find and could not.

Suggestions go to Mark directly, and nothing you send is published anywhere:

::: {.callout-note appearance=“minimal”} Write to mark dot khurana at sund dot ku dot dk

:::

If you would rather not email, the Report an issue link at the bottom of every chapter opens a GitHub issue instead — but note that GitHub issues are public, so use email for anything you would rather keep private.

Licence

Creative Commons Attribution 4.0. Use it, adapt it, share it — just give credit.