derive_vars_crit {admiralvaccine} | R Documentation |
Derive Analysis Criterion Evaluation Variables
Description
Derive analysis criterion evaluation result variable, paired with character
and numeric flags.
This function allows also the derivation of a CRIT like variable with a
different name (ex: ANL01FL
), without generating additional numeric (ex: ANL01FN
)
and character label (ex: ANL01
) variables.
Usage
derive_vars_crit(dataset, prefix, crit_label, condition, criterion)
Arguments
dataset |
Input dataset |
prefix |
Variables to add The analysis criterion evaluation variable's name (i.e., |
crit_label |
Criterion value A text description defining the condition necessary to satisfy the presence of the criterion |
condition |
Condition for selecting a subset The condition specified in order to select a subset from the input dataset in which the rule is applied. |
criterion |
Criterion rule The criterion that each selected row satisfies or not.
Returns |
Value
Dataset with criterion variables
Author(s)
Federico Baratin
See Also
Other der_var:
derive_var_aval_adis()
,
derive_vars_event_flag()
,
derive_vars_max_flag()
,
derive_vars_merged_vaccine()
,
derive_vars_params()
,
derive_vars_vaxdt()
Examples
library(tibble)
library(admiral)
library(admiraldev)
library(dplyr)
input <- tribble(
~USUBJID, ~AVISITN, ~ISCAT, ~PARAMCD, ~AVAL, ~ISLLOQ,
"999999-000001", 10, "IMMUNOLOGY", "J0033VN", 2, 4,
"999999-000001", 10, "IMMUNOLOGY", "I0019NT", 3, 6,
"999999-000001", 10, "IMMUNOLOGY", "M0019LN", 4, 4,
"999999-000001", 10, "IMMUNOLOGY", "R0003MA", 3, 6,
"999999-000001", 30, "IMMUNOLOGY", "J0033VN", 60, 4,
"999999-000001", 30, "IMMUNOLOGY", "I0019NT", 567, 6,
"999999-000001", 30, "IMMUNOLOGY", "M0019LN", 659, 4,
"999999-000001", 30, "IMMUNOLOGY", "R0003MA", 250, 6,
"999999-000002", 10, "IMMUNOLOGY", "J0033VN", 2, 4,
"999999-000002", 10, "IMMUNOLOGY", "I0019NT", 7, 6,
"999999-000002", 10, "IMMUNOLOGY", "M0019LN", 5, 4,
"999999-000002", 10, "IMMUNOLOGY", "R0003MA", 3, 6,
"999999-000002", 30, "IMMUNOLOGY", "J0033VN", 55, 4,
"999999-000002", 30, "IMMUNOLOGY", "I0019NT", 89, 6,
"999999-000002", 30, "IMMUNOLOGY", "M0019LN", 990, 4,
"999999-000002", 30, "IMMUNOLOGY", "R0003MA", 340, 6,
"999999-000003", 10, "IMMUNOLOGY", "J0033VN", 3, 4,
"999999-000003", 10, "IMMUNOLOGY", "I0019NT", 6, 6,
"999999-000003", 10, "IMMUNOLOGY", "M0019LN", 2, 4,
"999999-000003", 10, "IMMUNOLOGY", "R0003MA", 2, 6,
"999999-000003", 30, "IMMUNOLOGY", "J0033VN", 45, 4,
"999999-000003", 30, "IMMUNOLOGY", "I0019NT", 381, 6,
"999999-000003", 30, "IMMUNOLOGY", "M0019LN", 542, 4,
"999999-000003", 30, "IMMUNOLOGY", "R0003MA", NA, 6
)
derive_vars_crit(
dataset = input,
prefix = "CRIT1",
crit_label = "Titer >= ISLLOQ",
condition = !is.na(AVAL) & !is.na(ISLLOQ),
criterion = AVAL >= ISLLOQ
)