PerformExclusion: Apply exclusion criterion to data

Description Usage Arguments Value Author(s) Examples

View source: R/PerformExclusion.R

Description

By default, there are three criterion, age criterion, duration criterion, and frequency criterion.

Usage

1
2
3
4
5
6
7
PerformExclusion(
  preDat,
  crtVec = c(crt.los = TRUE, crt.freq = TRUE, crt.1stday = TRUE),
  ageRange = c(16, 120),
  losNum_hour = 24,
  freqNum = 5
)

Arguments

preDat

A data.table prepared by GenEpisode.

crtVec

A boolean vector of length 3, indicating whether to exclude patients by length of stay, frequency of BG measurements, and whether to exclude the readings taken within the first 24 hours.

ageRange

A vector specifying the age range. Any patient younger than the minimum age or older than the maximum age should be excluded. This exclusion criterion requires the data to have a BIRTH.DATE column or an AGE column, otherwise it will be ignored.

losNum_hour

A number specifying the length of stay criterion. A hospital stay need to be greater than this value to be included in the analysis. This is an optional exclusion criterion.

freqNum

A numeric value specifying the smallest frequency of BG within a hospital stay needed for the analysis. This is an optional criterion.

Value

Returns a list with a vector of exclusion criteria and the data.table after applying exclusion criteria.

Author(s)

Ying Chen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Focus on data from Ward A. First prepare data using GenEpisode:
data("gluDat")
gluDat2 <- FormatDate(dat = gluDat[gluDat$LOCATION == "A", ], yy = 2020, mm = 7)
gluDat3 <- GenEpisode(dat = gluDat2, epiMethod = "Admininfo")
# Create an "AGE" column with all values assigned to "AGE" to indicate that age
# is not available in this data:
gluDat3$AGE <- "AGE"
# Then apply exclusion criteria:
exlList <- PerformExclusion(preDat = gluDat3)
exlList

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