diabetic-utils / clinicalMAGE
clinicalMAGE(
readings
,options
):number
Defined in: mage.ts:25
Calculates clinical-grade Mean Amplitude of Glycemic Excursions (MAGE). Implements gold-standard Service FJ et al. (1970) methodology with modern optimizations and clinical validation.
number
[]
Array of glucose values (mg/dL or mmol/L)
MAGEOptions
= {}
Configuration options for MAGE calculation
number
MAGE value, or NaN if insufficient data or no valid excursions
// Basic usage
glucoseMAGE([100, 120, 80, 160, 90, 140, 70, 180])
// Advanced usage
glucoseMAGE(readings, { shortWindow: 5, longWindow: 32, direction: 'auto' })