lookup_limits {zlog} | R Documentation |
Lookup Limits in Reference Tables
Description
Reference limits are specific for age and sex. Each laboratory institute has its own reference limits. This function is useful to query a dataset against this database.
Usage
lookup_limits(age, sex, table)
Arguments
age |
|
sex |
|
table |
|
Value
matrix
, with 2 columns ("lower", "upper") and as many rows as
length(age)
.
Author(s)
Sebastian Gibb
Examples
reference <- data.frame(
param = c("albumin", rep("bilirubin", 4)),
age = c(0, 1, 2, 3, 7), # days
sex = "both",
units = c("g/l", rep("µmol/l", 4)), # ignored
lower = c(35, rep(NA, 4)), # no real reference values
upper = c(52, 5, 8, 13, 18) # no real reference values
)
# lookup albumin reference values for 18 year old woman
lookup_limits(
age = 18 * 365.25,
sex = "female",
table = reference[reference$param == "albumin",]
)
# lookup albumin and bilirubin values for 18 year old woman
lookup_limits(
age = 18 * 365.25,
sex = "female",
table = reference
)
# lookup bilirubin referenc values for infants
lookup_limits(
age = 0:8,
sex = rep(c("female", "male"), 5:4),
table = reference[reference$param == "bilirubin",]
)