tgt_hba1c: Creates a set of logical variables which compare HbA1c values...

Description Usage Arguments Author(s) Examples

View source: R/tgt_hba1c.R

Description

The function takes an existing dataframe, which contains a variable of HbA1c test results, and measures the result against a set of treatment target levels. The target levels are set at 0.5 per cent intervals (DCCT), ranging from 6.5 per cent through to 9.0 per cent, with a final 10.0 per cent upper level. A separate logical variable is produced for each target, with a TRUE or FALSE value to indicate whether the test value is below the respective target levels. The full set of target variables are appended to the existing dataframe.

Usage

1

Arguments

x

Dataframe containing a variable of HbA1c test results. The created target variables will be appended to this dataframe.

y

Numeric vector of HbA1c values [IFCC mmol/mol].

Author(s)

Julian Collins

Examples

1
2
3
4
5
# A numeric variable of HbA1c values, within a dataframe
data <- tibble::tibble(hba1c_values = rnorm(25, 65, 15))

# Measure the HbA1c test results against the full set of targets, adding logical variables to the dataframe
data <- tgt_hba1c(data, data$hba1c_values)

KHP-IDEO/rIDEO documentation built on Aug. 11, 2019, 4:29 p.m.