derive_var_bcvacritxfl_util: Add 'CRITx'/'CRITxFL' pair to BCVA dataset

View source: R/derive_var_bcvacritxfl.R

derive_var_bcvacritxfl_utilR Documentation

Add CRITx/CRITxFL pair to BCVA dataset

Description

[Superseded] The derive_var_bcvacritxfl_util() function has been superseded in favor of admiral::derive_vars_crit_flag().

Helper function for derive_var_bcvacritxfl() that adds a criterion variable CRITx and its corresponding flag CRITxFL to a dataset containing BCVA records

Usage

derive_var_bcvacritxfl_util(
  dataset,
  crit_var,
  critx_text,
  critxfl_cond,
  counter,
  bcva_range = NULL,
  bcva_uplim = NULL,
  bcva_lowlim = NULL
)

Arguments

dataset

Input dataset (usually ADBCVA).

crit_var

Variable with respect to which CRITx/CRITxFL are derived (usually CHG or AVAL).

critx_text

String containing the text for CRITx variable.

critxfl_cond

String containing R code detailing the criterion to be satisfied for CRITxFL variable to be equal to "Y".

counter

Integer detailing the value of x to use in CRITxFL.

bcva_range

Numeric vector of length two detailing lower and upper change in BCVA limits (bcva_range will be called in critxfl_cond if the criterion stipulates that change in BCVA lie inside some range).

bcva_uplim

Numeric value detailing highest change in BCVA limit (bcva_uplim will be called in critxfl_cond if the criterion stipulates that change in BCVA lie below some upper limit).

bcva_lowlim

Numeric value detailing lowest change in BCVA limit (bcva_lowlim will be called in critxfl_cond if the criterion stipulates that change in BCVA lie above some lower limit).

Details

The criterion for change in BCVA in CRITxFL can be of three types: (1) value lies within some range; ⁠a <= crit_var <= b⁠; (2) value is below some upper limit; crit_var <= a; (3) value is above some lower limit; b <= crit_var. For (1), bcva_range must be specified to this function; for (2), bcva_uplim; for (3) bcva_lowlim. It is necessary to supply at least one of these three arguments. NOTE: if crit_var is equal to NA, then the resulting criterion flag is also marked as NA.

Value

The input BCVA dataset with additional columns CRITx, CRITxFL.

Author(s)

Edoardo Mancini


admiralophtha documentation built on April 3, 2025, 9:46 p.m.