Description Usage Arguments Details Value Author(s) References Examples
The function mag calculates the mean absolute glucose or MAG.
1 |
data |
DataFrame object with column names "id", "time", and "gl". |
n |
Integer giving the desired interval in minutes over which to calculate the change in glucose. Default is 60 to have hourly (60 minutes) intervals. |
dt0 |
The time frequency for interpolation in minutes, the default will match the CGM meter's frequency (e.g. 5 min for Dexcom). |
inter_gap |
The maximum allowable gap (in minutes) for interpolation. The values will not be interpolated between the glucose measurements that are more than inter_gap minutes apart. The default value is 45 min. |
tz |
A character string specifying the time zone to be used. System-specific (see |
A tibble object with a column for subject id and a column for MAG values is returned.
The glucose values are linearly interpolated over a time grid starting at the beginning of the first day of data and ending on the last day of data. Then, MAG is calculated as \frac{|Δ BG|}{Δ t} where |Δ BG| is the sum of the absolute change in blood glucose calculated for each interval as specified by n, default n = 60 for hourly change in blood glucose. The sum is then divided by Δ t which is the total time in hours.
A tibble object with two columns: subject id and MAG value
Elizabeth Chun
Hermanides et al. (2010) Glucose Variability is Associated with Intensive Care Unit Mortaility, Critical Care Medicine 38(3) 838-842, doi: 10.1097/CCM.0b013e3181cc4be9
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.