derive_var_anrind {admiral}R Documentation

Derive Reference Range Indicator

Description

Derive Reference Range Indicator

Usage

derive_var_anrind(dataset)

Arguments

dataset

The input dataset

Details

ANRIND is set to

Value

The input dataset with additional column ANRIND

Author(s)

Thomas Neitmann

See Also

BDS-Findings Functions that returns variable appended to dataset: derive_var_analysis_ratio(), derive_var_atoxgr_dir(), derive_var_atoxgr(), derive_var_basetype(), derive_var_base(), derive_var_chg(), derive_var_ontrtfl(), derive_var_pchg(), derive_var_shift()

Examples

library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
data(admiral_vs)

ref_ranges <- tibble::tribble(
  ~PARAMCD, ~ANRLO, ~ANRHI, ~A1LO, ~A1HI,
  "DIABP",      60,     80,    40,    90,
  "PULSE",      60,    100,    40,   110
)

admiral_vs %>%
  mutate(
    PARAMCD = VSTESTCD,
    AVAL = VSSTRESN
  ) %>%
  filter(PARAMCD %in% c("PULSE", "DIABP")) %>%
  derive_vars_merged(ref_ranges, by_vars = vars(PARAMCD)) %>%
  derive_var_anrind() %>%
  select(USUBJID, PARAMCD, AVAL, ANRLO:ANRIND)

[Package admiral version 0.8.4 Index]