Skip to content
Sandra edited this page Aug 17, 2023 · 7 revisions

Welcome to the AdRI_GAMLSS wiki!

This Shiny App was developed to create Age-dependent Reference Intervals (AdRI_GAMLSS) using Generalized additive models for location, scale and shape (GAMLSS).

*** Warning! This Shiny App has not been enough validated for the basis of a medical diagnosis! There is no warranty for the app and/or the reference intervals! ***

The distribution of the data for the LMS-Method is selected from the Box-Cox Cole & Green Distribution (BCCG), Box-Cox Power Exponential Distribution (BCPE) or Box-Cox t-Distribution (BCT) and for GAMLSS additionally the Normal-Distribution (NO) and Log-Normal-Distribution (LOGNO). The models are created with the package gamlss. The GAMLSS have different additive terms for smoothing.

Reference Intervals are established using the central 95% range of measurements, defined by the 2.5th and 97.5th percentiles. All tables can be saved as CSV. For plotly figures use the menu in the right corner.

Installation

Method 1: Use the function runGitHub() from the package shiny:

if("shiny" %in% rownames(installed.packages())){
  library(shiny)} else{
  install.packages("shiny")
  library(shiny)}
runGitHub("AdRI_GAMLSS", "SandraKla")

Method 2: Download the Zip-File from this Shiny App. Unzip the file and set your working direction to the path of the folder. The package shiny and shinydashboard must be installed before using the Shiny App:

# Test if shiny is installed:
if("shiny" %in% rownames(installed.packages())){
  library(shiny)} else{
  install.packages("shiny")
  library(shiny)}

And then start the app with the following code:

runApp("app.R")

All required packages are downloaded when starting this app or imported if they already exist.

Preprocessing

The data is loaded with read.csv2() and the tables are written with write.csv2(). The CSV file has a semicolon as separator. The data must contain the following information: SEX ("F" = female, "M" = male), AGE_DAYS (age in days), AGE_YEARS (age in years), VALUE (value of the analyte) and ANALYTE (name of the analyte):

SEX;AGE_DAYS;AGE_YEARS;VALUE;ANALYTE
M;2;0;1;EXAMPLE
F;2;0;2;EXAMPLE
F;3;0;;EXAMPLE
F;3;0;1;EXAMPLE
M;3;0;2;EXAMPLE

The data set can be presorted:

  • with the Age Range in years or in days
  • with the Sex
  • with the use of the First unique value. The default is TRUE (double or multiple values of the same patient will not be considered)
  • ID (patient number) is automatic filled with unique numbers (if not specified)
  • STATION (station code)- filled with NA (if not specified)
  • Delete data with NA in VALUE (value of the analyte)

Generalized additive models for location, scale and shape (GAMLSS)

Generalized additive models for location, scale and shape (GAMLSS) are distributional regression models, where all the parameters of the assumed distribution for the response can be modeled as additive functions of the explanatory variables. GAMLSS can be created with various distributions and different additive terms for smoothing. They are parametric, in that they require a parametric distribution assumption for the response variable, and semiparametric in the sense that the modelling of the parameters involve non-parametric smoothing functions. The models create different functions, g stands for link-functions and h for the smooth methods for each parameter (µ = mean, σ = standard deviation, ν = skewness, τ = kurtosis):

`g1(µ) = h1(µ)`
`g2(σ) = h2(σ)`
`g3(ν) = h3(ν)`
`g4(τ) = h4(τ)`

The following distributions can be used for the GAMLSS:

  • Normal Distribution (NO)
  • Log-Normal Distribution (LOGNO)
  • Box-Cole Green Distribution (BCCGo)
  • Box-Cole Green Exp. Distribution (BCPEo)
  • Box-Cole Green t-Distribution (BCTo)

The package gamlss is used for the Age-dependent Reference Intervals, where six different additive terms are used:

  • P-Splines
  • Cubic Splines
  • Polynomial (Degree 3)
  • Polynomial (Degree 4)
  • Neural Network
  • Decision Tree

Hyperparameter:

  • Epochs: 50
  • Algorithm of Rigby & Stasinopoulos (RS)
  • Neural Network: µ = 4 Hidden Layers, σ = 3 Hidden Layers, ν = 1 Hidden Layer, τ = 1 Hidden Layer, all decay=0.1

The models can be compared to the following metrics:

  • Statistic Plots: QQ-Plot, Wormplots and other plot for the analysis
  • Akaike Information Criterion (AIC)
  • Bayesian Information Criterion (BIC) / Schwatz Bayesian Criterion (SBC)
  • Generalized Information Criterion (GAIC)
  • Pseudo R-Squared (R2)

Versions

Abbreviations

RI = Reference Intervals CI = Confidence Intervals

Contact

You are welcome to:

Link to the publication: A visualization tool for continuous reference intervals based on GAMLSS

References

David A Colantonio, Lianna Kyriakopoulou, Man Khun Chan, Caitlin H Daly, Davor Brinc, Allison A Venner, Maria D Pasic, David Armbruster, Khosrow Adeli, Closing the Gaps in Pediatric Laboratory Reference Intervals: A CALIPER Database of 40 Biochemical Markers in a Healthy and Multiethnic Population of Children, Clinical Chemistry, Volume 58, Issue 5, 1 May 2012, Pages 854–868, https://doi.org/10.1373/clinchem.2011.177741

Rigby R.A. and Stasinopoulos D.M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554, 10.1111/j.1467-9876.2005.00510.x.

Rigby, Robert & Stasinopoulos, Dm & Heller, Gillian & De Bastiani, Fernanda. (2019). Distributions for Modeling Location, Scale, and Shape: Using GAMLSS in R. 10.1201/9780429298547.

Stasinopoulos, Dm & Rigby, Robert & Heller, Gillian & Voudouris, Vlasios & De Bastiani, Fernanda. (2017). Flexible regression and smoothing: Using GAMLSS in R. 10.1201/b21973.

Stasinopoulos, Dm & Rigby, Robert. (2007). Generalized additive models for Location Scale and Shape (GAMLSS) in R. Journal of Statistical Software. 23. 10.18637/jss.v023.i07.