derive_var_anrind: Derive Reference Range Indicator

Description Usage Arguments Details Value Author(s) Examples

View source: R/derive_var_anrind.R

Description

Derive Reference Range Indicator

Usage

1

Arguments

dataset

The input dataset

Details

ANRIND is set to

Value

The input dataset with additional column ANRIND

Author(s)

Thomas Neitmann

Examples

 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)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.