Statistical Data Analysis of Continuous Glucose Monitoring

Lecture Notes. DiabeTECH MSc.

Author

Óscar Lado Baleato

Published

March 21, 2026

Welcome

This book is a translation and adaptation of a master-level course [Master in Diabetes Technology – DiabeTECH] on Applied Statistics in Diabetes Technology.

Full program of DiabeTECH Master (here): DiabeTECH

Applied Statistics in Diabetes Technology

Mandatory theoretical course. Online. 2 ECTS.
Professor: Óscar Lado Baleato.

This interactive books aims to covers the entire workflow from data import and cleaning to advanced modeling and multivariate analysis of novel data in the context of Diabetes Technology.

0.1 Prerequisites

  • Basic knowledge of R and RStudio [DiabeTECH student: please make sure you are up to date with both basic and advanced Statistical courses given by Professor José Ramón Muñoz].

  • Familiarity with diabetes and CGM technology is helpful but not required.

  • The Colas dataset (Colás et al. 2019) (208 patients) is used throughout. Downloaded from Awesome-CGM repository.

I am deeply grateful to Doctors: Ana Colás, Luis Vigil, Beatriz Vargas, David Cuesta-Frau, and María Varela for sharing their data freely. Every data point represents countless hours of professional dedication, driven by the goal of advancing knowledge for the benefit of others. Please see their work (Colás et al. 2019) for a detailed description of the study and the generous data sharing effort.

0.2 How to Use This Book

Each chapter corresponds to one session of the original course. Code chunks are provided for all analyses, and you are encouraged to run them interactively. References to key literature are given at the end of each chapter and in the bibliography.

0.3 R Packages Used

We will use the following packages:

  • readr, haven for data import into R session.

  • cgmanalysis for cleaning raw CGM files.

  • iglu for calculating glucose variability metrics.

  • biosensors.usc for glucodensity analysis.

Install them with:

install.packages(c("readr", "haven", "cgmanalysis", "iglu", "biosensors.usc"))

Disclaimer: I may use some additional packages I am not currently aware of. Future releases of these materials will polish mistakes encounter by readers regarding R packages.