modd: Calculate mean difference between glucose values obtained at the same time
of day (MODD)
Description
The function modd produces MODD values in a tibble object.
Usage
modd(data, lag = 1, tz = "")
Value
A tibble object with two columns: subject id and corresponding MODD value.
Arguments
data
DataFrame object with column names "id", "time", and "gl".
lag
Integer indicating which lag (# days) to use. Default is 1.
tz
A character string specifying the time zone to be used. System-specific (see as.POSIXct), but " " is the current time zone, and "GMT" is UTC (Universal Time, Coordinated). Invalid values are most commonly treated as UTC, on some platforms with a warning.
Details
A tibble object with 1 row for each subject, a column for subject id and
a column for the MODD values is returned.
Missing values will be linearly interpolated when close enough to non-missing values.
MODD is calculated by taking the mean of absolute differences between
measurements at the same time 1 day away, or more if lag parameter
is set to an integer > 1.
References
Service, F. J. & Nelson, R. L. (1980) Characteristics of glycemic stability.
Diabetes care3 .58-62,
tools:::Rd_expr_doi("10.2337/diacare.3.1.58").