m_value | R Documentation |
Calculates the M-value of Schlichtkrull et al. (1965) for each subject in the data, where the M-value is the mean of the logarithmic transformation of the deviation from a reference value. Produces a tibble object with subject id and M-values.
m_value(data, r = 90)
data |
DataFrame object with column names "id", "time", and "gl", or numeric vector of glucose values. |
r |
A reference value corresponding to basal glycemia in normal subjects; default is 90 mg/dL. |
A tibble object with 1 row for each subject, a column for subject id and a column for the M-values is returned. NA glucose values are omitted from the calculation of the M-value.
M-value is computed by averaging the transformed glucose values, where each
transformed value is equal to |10 * log_{10}(glucose/r)|^3
, where r is the specified reference value.
If a data.frame object is passed, then a tibble object with two columns: subject id and corresponding M-value is returned. If a vector of glucose values is passed, then a tibble object with just the M-value is returned. as.numeric() can be wrapped around the latter to output just a numeric value.
Schlichtkrull J, Munck O, Jersild M. (1965) The M-value, an index of blood-sugar control in diabetics. Acta Medica Scandinavica 177 .95-102. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.0954-6820.1965.tb01810.x")}.
data(example_data_5_subject)
m_value(example_data_5_subject)
m_value(example_data_5_subject, r = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.