diabetic-utils / glucoseMAGE
glucoseMAGE(
readings
,options?
):number
Defined in: variability.ts:104
Calculates Mean Amplitude of Glycemic Excursions (MAGE) for glucose values. Implements gold-standard Service FJ et al. (1970) clinical methodology, validated to 1.4% median error vs manual calculations.
number
[]
Array of glucose values (mg/dL or mmol/L)
Optional configuration for MAGE calculation
number
MAGE value, or NaN if insufficient data or no valid excursions
glucoseMAGE([100, 120, 80, 160, 90, 140, 70, 180])
glucoseMAGE(readings, { direction: 'ascending', shortWindow: 5, longWindow: 32 })