Description Usage Arguments Details Value Author(s) Examples
View source: R/derive_var_anrind.R
Derive Reference Range Indicator
1 | derive_var_anrind(dataset)
|
dataset |
The input dataset |
ANRIND
is set to
"NORMAL"
if AVAL
is greater or equal ANRLO
and less than
or equal ANRHI
; or if AVAL
is greater than or equal ANRLO
and ANRHI
is missing; or if AVAL
is less than or equal ANRHI
and ANRLO
is
missing
"LOW"
if AVAL
is less than ANRLO
and either A1LO
is missing or AVAL
is greater than or equal A1LO
"HIGH"
if AVAL
is greater than ANRHI
and either A1HI
is missing or AVAL
is less than or equal A1HI
"LOW LOW"
if AVAL
is less than A1LO
"HIGH HIGH"
if AVAL
is greater than A1HI
The input dataset with additional column ANRIND
Thomas Neitmann
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
data(vs)
ref_ranges <- tibble::tribble(
~PARAMCD, ~ANRLO, ~ANRHI, ~A1LO, ~A1HI,
"DIABP", 60, 80, 40, 90,
"PULSE", 60, 100, 40, 110
)
vs %>%
mutate(
PARAMCD = VSTESTCD,
AVAL = VSSTRESN
) %>%
filter(PARAMCD %in% c("PULSE", "DIABP")) %>%
left_join(ref_ranges, by = "PARAMCD") %>%
derive_var_anrind() %>%
select(USUBJID, PARAMCD, AVAL, ANRLO:ANRIND)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.