Description Usage Arguments Details Value References Examples
The function mage produces MAGE values in a tibble object.
1 |
data |
DataFrame object with column names "id", "time", and "gl", or numeric vector of glucose values. |
sd_multiplier |
A numeric value that can change the sd value used to determine size of glycemic excursions used in the calculation. |
A tibble object with 1 row for each subject, a column for subject id and a column for the MAGE values is returned. NA glucose values are omitted from the calculation of MAGE.
MAGE is calculated by taking the mean of absolute differences (between each value and the mean) that are greater than the standard deviation. A multiplier can be added to the standard deviation by the sd_multiplier argument.
If a data.frame object is passed, then a tibble object with two columns: subject id and corresponding MAGE value is returned. If a vector of glucose values is passed, then a tibble object with just the MAGE value is returned. as.numeric() can be wrapped around the latter to output just a numeric value.
Service, F. J. & Nelson, R. L. (1980) Characteristics of glycemic stability. Diabetes care 3 .58-62, doi: 10.2337/diacare.3.1.58.
1 2 3 4 5 6 | data(example_data_1_subject)
mage(example_data_1_subject)
mage(example_data_1_subject, sd_multiplier = 2)
data(example_data_5_subject)
mage(example_data_5_subject, sd_multiplier = .9)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.