GenGluM: Generate glucometrics

Description Usage Arguments Value Author(s) See Also Examples

View source: R/GenGluM.R

Description

Generate glucometrics for specific ward/wards during specified time period

Usage

1
GenGluM(dat, hypocutoffs, hypercutoffs, normalrange, hgicutoff, unitVal)

Arguments

dat

A data.table prepared by GenEpisode.

hypocutoffs

A vector of numeric values indicating the recommended cutoffs for hypoglycemia, from mild, moderate to severe hypoglycemia. Hypoglycemia is defined as less than the specified cutoff value.

hypercutoffs

A vector of numeric values indicating the recommended cutoffs for hyperglycemia, from mild, moderate to severe hyperglycemia. Hyperglycemia is defined as no less than the specified cutoff value.

normalrange

A vector of numeric values indicating the recommended range for normal glycemia, where the first value is the lower range, and the second value is the upper range. A BG is considered in recommended range if it is no less than a lower bound and less than a upper bound at the same time.

hgicutoff

A numeric value indicating the cutoff used for calculating hyperglycemic index (HGI).

unitVal

A unit indicator. 1 stands for mmol/L, 2 stands for md/dL

Value

Returns a list of three data.frames:

which will be used as input to generate glucometrics tables.

Author(s)

Ying Chen, Chuen Seng Tan

See Also

ProGluTable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Focus on data from Ward A. First prepare example data using GenEpisode:
data("gluDat")
gluDat2 <- FormatDate(dat = gluDat[gluDat$LOCATION == "A", ], yy = 2020, mm = 7)
gluDat3 <- GenEpisode(dat = gluDat2, epiMethod = "Admininfo")
# Then generate glucometrics:
metricList <- GenGluM(dat = gluDat3, hypocutoffs = c(4, 3, 2.5),
                      hypercutoffs = c(14, 20, 24), normalrange = c(4, 10),
                      hgicutoff = 10, unitVal = 1)
# View glucometrics (round to 1 decimal place):
lapply(metricList, function(m) round(m, 1))

nyilin/QcDM documentation built on June 29, 2021, 1:14 a.m.