Skip to contents

Returns the convention record documenting how a variable is typically populated — e.g. TRTP carried forward from ADSL$TRT01P. These are conventions, not enforcement rules: multi-period studies, crossover protocols, and analysis-visit-windowing studies legitimately deviate, and the returned record names those exceptions.

Usage

retained_variable_convention(var)

Arguments

var

Scalar character variable name.

Value

A named list with convention (the convention group name, e.g. "treatment_variables"), description, inherit (how the variable is populated), and exceptions. Returns NULL when no convention covers the variable.

Examples

retained_variable_convention("TRTP")
#> $convention
#> [1] "treatment_variables"
#> 
#> $description
#> [1] "In non-ADSL ADaM datasets, TRTP/TRTA (+N companions) typically copy from ADSL's TRT01P/TRT01A. Multi-period and crossover studies DERIVE these per record from APERIOD.\n"
#> 
#> $inherit
#> $inherit$origin
#> [1] "Predecessor"
#> 
#> $inherit$predecessor_dataset
#> [1] "ADSL"
#> 
#> $inherit$predecessor_variable
#> $inherit$predecessor_variable$TRTP
#> [1] "TRT01P"
#> 
#> $inherit$predecessor_variable$TRTA
#> [1] "TRT01A"
#> 
#> $inherit$predecessor_variable$TRTPN
#> [1] "TRT01PN"
#> 
#> $inherit$predecessor_variable$TRTAN
#> [1] "TRT01AN"
#> 
#> 
#> 
#> $exceptions
#> $exceptions[[1]]
#> $exceptions[[1]]$scenario
#> [1] "Multi-period or crossover study with APERIOD-driven treatment"
#> 
#> $exceptions[[1]]$origin
#> [1] "Derived"
#> 
#> $exceptions[[1]]$note
#> [1] "Method describes the APERIOD-to-TRT mapping; Predecessor is not used."
#> 
#> 
#> 
retained_variable_convention("STUDYID")
#> $convention
#> [1] "adsl_retained_core"
#> 
#> $description
#> [1] "ADaMIG Table 3.3.1 Core Variables typically flow downstream from ADSL rather than being re-derived from SDTM.DM in each dataset. Some sponsors prefer to merge fresh from SDTM.DM.\n"
#> 
#> $inherit
#> $inherit$origin
#> [1] "Predecessor"
#> 
#> $inherit$predecessor_dataset
#> [1] "ADSL"
#> 
#> $inherit$predecessor_variable
#> [1] "<same name>"
#> 
#> 
#> $exceptions
#> $exceptions[[1]]
#> $exceptions[[1]]$scenario
#> [1] "Sponsor merges fresh from SDTM.DM in each ADaM dataset"
#> 
#> $exceptions[[1]]$origin
#> [1] "Predecessor"
#> 
#> $exceptions[[1]]$predecessor_dataset
#> [1] "DM"
#> 
#> $exceptions[[1]]$note
#> [1] "Legitimate sponsor variation; flag as style difference only."
#> 
#> 
#>