Skip to contents

Derivations for Adding Variables

All ADaMs

derive_var_confirmation_flag()
Derive Confirmation Flag
derive_var_extreme_flag()
Add a Variable Flagging the First or Last Observation Within Each By Group
derive_var_last_dose_amt()
Derive Last Dose Amount
derive_var_last_dose_date()
Derive Last Dose Date-Time
derive_var_last_dose_grp()
Derive Last Dose with User-Defined Groupings
derive_var_merged_cat()
Merge a Categorization Variable
derive_var_merged_character()
Merge a Character Variable
derive_var_merged_exist_flag()
Merge an Existence Flag
derive_var_obs_number()
Adds a Variable Numbering the Observations Within Each By Group
derive_var_trtdurd()
Derive Total Treatment Duration (Days)
derive_var_worst_flag()
Adds a Variable Flagging the Maximal / Minimal Value Within a Group of Observations
derive_vars_dt()
Derive/Impute a Date from a Date Character Vector
derive_vars_dtm()
Derive/Impute a Datetime from a Date Character Vector
derive_vars_dtm_to_dt()
Derive Date Variables from Datetime Variables
derive_vars_dtm_to_tm()
Derive Time Variables from Datetime Variables
derive_vars_duration()
Derive Duration
derive_vars_dy()
Derive Relative Day Variables
derive_vars_last_dose()
Derive Last Dose
derive_vars_merged()
Add New Variable(s) to the Input Dataset Based on Variables from Another Dataset
derive_vars_merged_lookup()
Merge Lookup Table with Source Dataset
derive_vars_transposed()
Derive Variables by Transposing and Merging a Second Dataset
get_summary_records()
Create Summary Records

ADSL-specific

Derivation Functions helpful for building the ADSL dataset

derive_var_age_years()
Derive Age in Years
derive_var_disposition_status()
Derive a Disposition Status at a Specific Timepoint
derive_var_dthcaus() dthcaus_source()
Derive Death Cause
derive_var_extreme_dt()
Derive First or Last Date from Multiple Sources
derive_var_extreme_dtm()
Derive First or Last Datetime from Multiple Sources
derive_vars_aage()
Derive Analysis Age
derive_vars_disposition_reason()
Derive a Disposition Reason at a Specific Timepoint

BDS-specific

Derivation Functions helpful for building the BDS datasets (e.g. advs, adlb, adeg, adex)

derive_var_analysis_ratio()
Derive Ratio Variable
derive_var_anrind()
Derive Reference Range Indicator
derive_var_atoxgr()
Derive Lab High toxicity Grade 0 - 4 and Low Toxicity Grades 0 - (-4)
derive_var_atoxgr_dir()
Derive Lab Toxicity Grade 0 - 4
derive_var_base()
Derive Baseline Variables
derive_var_basetype()
Derive BASETYPE Variable
derive_var_chg()
Derive Change from Baseline
derive_var_ontrtfl()
Derive On-Treatment Flag Variable
derive_var_pchg()
Derive Percent Change from Baseline
derive_var_shift()
Derive Shift

OCCDS-specific

Derivation Functions helpful for building the OCCDS datasets (e.g. adae, adcm, admh)

create_query_data()
Creates a queries dataset as input dataset to the dataset_queries argument in derive_vars_query()
create_single_dose_dataset()
Create dataset of single doses
derive_vars_atc()
Derive ATC Class Variables
derive_vars_query()
Derive Query Variables
get_terms_from_db()
Get Terms from the Queries Database

Derivations for Adding Parameters/Records

BDS-specific

default_qtc_paramcd()
Get Default Parameter Code for Corrected QT
derive_extreme_records()
Add the First or Last Observation for Each By Group as New Records
derive_param_bmi()
Adds a Parameter for BMI
derive_param_bsa()
Adds a Parameter for BSA (Body Surface Area) Using the Specified Method
derive_param_computed()
Adds a Parameter Computed from the Analysis Value of Other Parameters
derive_param_doseint()
Adds a Parameter for Dose Intensity
derive_param_exist_flag()
Add an Existence Flag Parameter
derive_param_exposure()
Add an Aggregated Parameter and Derive the Associated Start and End Dates
derive_param_first_event()
Add a First Event Parameter
derive_param_framingham()
Adds a Parameter for Framingham Heart Study Cardiovascular Disease 10-Year Risk Score
derive_param_map()
Adds a Parameter for Mean Arterial Pressure
derive_param_qtc()
Adds a Parameter for Corrected QT (an ECG measurement)
derive_param_rr()
Adds a Parameter for Derived RR (an ECG measurement)
derive_param_wbc_abs()
Add a parameter for lab differentials converted to absolute values
derive_summary_records()
Add New Records Within By Groups Using Aggregation Functions

TTE-specific

derive_param_tte()
Derive a Time-to-Event Parameter

Advanced Functions

Higher Order

call_derivation()
Call a Single Derivation Multiple Times
derivation_slice()
Create a derivation_slice Object
print(<derivation_slice>)
Print derivation_slice Objects
restrict_derivation()
Execute a Derivation on a Subset of the Input Dataset
slice_derivation()
Execute a Derivation with Different Arguments for Subsets of the Input Dataset

Metadata

dose_freq_lookup
Pre-Defined Dose Frequencies

Other

assert_db_requirements()
Check required parameters for SMQ/SDG
assert_terms()
Asserts Requirements for Terms for Queries
assert_valid_queries()
Verify if a Dataset Has the Required Format as Queries Dataset.
censor_source()
Create a censor_source Object
date_source()
Create a date_source object
derive_var_dthcaus() dthcaus_source()
Derive Death Cause
event_source()
Create an event_source Object
extend_source_datasets()
Add By Groups to All Datasets if Necessary
filter_date_sources()
Select the First or Last Date from Several Sources
format(<sdg_select>)
Returns a Character Representation of a sdg_select() Object
format(<smq_select>)
Returns a Character Representation of a smq_select() Object
list_tte_source_objects()
List all tte_source Objects Available in a Package
params()
Create a Set of Parameters
query()
Create an query object
sdg_select()
Create an sdg_select object
smq_select()
Create an smq_select object
tte_source()
Create a tte_source Object
death_event lastalive_censor ae_event ae_ser_event ae_gr1_event ae_gr2_event ae_gr3_event ae_gr4_event ae_gr5_event ae_gr35_event ae_sev_event ae_wd_event
Pre-Defined Time-to-Event Source Objects
validate_query()
Validate an object is indeed a query object
validate_sdg_select()
Validate an object is indeed a sdg_select object
validate_smq_select()
Validate an object is indeed a smq_select object

Computation Functions for Vectors

All ADaMs

compute_dtf()
Derive the Date Imputation Flag
compute_duration()
Compute Duration
compute_tmf()
Derive the Time Imputation Flag
convert_date_to_dtm()
Convert a Date into a Datetime Object
convert_dtc_to_dt()
Convert a Date Character Vector into a Date Object
convert_dtc_to_dtm()
Convert a Date Character Vector into a Datetime Object
impute_dtc_dt()
Impute Partial Date Portion of a '--DTC' Variable
impute_dtc_dtm()
Impute Partial Date(-time) Portion of a '--DTC' Variable

BDS-specific

compute_bmi()
Compute Body Mass Index (BMI)
compute_bsa()
Compute Body Surface Area (BSA)
compute_framingham()
Compute Framingham Heart Study Cardiovascular Disease 10-Year Risk Score
compute_map()
Compute Mean Arterial Pressure (MAP)
compute_qtc()
Compute Corrected QT
compute_qual_imputation()
Function to Impute Values When Qualifier Exists in Character Result
compute_qual_imputation_dec()
Compute Factor for Value Imputations When Character Value Contains < or >
compute_rr()
Compute RR Interval From Heart Rate

Utility Functions

Utilities for Formatting Observations

convert_blanks_to_na()
Convert Blank Strings Into NAs
format_eoxxstt_default()
Default Format for Disposition Status
format_reason_default()
Default Format for the Disposition Reason
yn_to_numeric()
Map "Y" and "N" to Numeric Values

Utilities for Dataset Checking

extract_duplicate_records()
Extract Duplicate Records
get_duplicates_dataset()
Get Duplicate Records that Lead to a Prior Error
get_many_to_one_dataset()
Get Many to One Values that Led to a Prior Error
get_one_to_many_dataset()
Get One to Many Values that Led to a Prior Error

Utilities used within Derivation Functions

call_user_fun()
Calls a Function Provided by the User
extract_unit()
Extract Unit From Parameter Description
get_not_mapped()
Get list of records not mapped from the lookup table.
signal_duplicate_records()
Signal Duplicate Records

Utilities for Filtering Observations

count_vals()
Count Number of Observations Where a Variable Equals a Value
filter_confirmation()
Filter Confirmed Observations
filter_extreme()
Filter the First or Last Observation for Each By Group
filter_relative()
Filter the Observations Before or After a Condition is Fulfilled
max_cond()
Maximum Value on a Subset
min_cond()
Minimum Value on a Subset

Utilities used for Date Imputation

dt_level()
Create a dt_level object
dtm_level()
Create a dtm_level object
get_imputation_target_date()
Get Date Imputation Targets
get_imputation_target_time()
Get Time Imputation Targets
get_partialdatetime()
Parse DTC variable and Determine Components
restrict_imputed_dtc_dt()
Restrict Imputed DTC date to Minimum/Maximum Dates
restrict_imputed_dtc_dtm()
Restrict Imputed DTC date to Minimum/Maximum Dates

Utilities used for Examples and Template Scripts

list_all_templates()
List All Available ADaM Templates
use_ad_template()
Open an ADaM Template Script

Example Datasets

You can run use_ad_template() to produce additional datasets

admiral_adsl
Subject Level Analysis Dataset
atoxgr_criteria_ctcv4
Metadata Holding Grading Criteria for NCI-CTCAEv4
ex_single
Single Dose Exposure Dataset
queries
Queries Dataset
queries_mh
Queries MH Dataset

Deprecated

derive_derived_param()
Adds a Parameter Computed from the Analysis Value of Other Parameters
derive_var_ady()
Derive Analysis Study Day
derive_var_aendy()
Derive Analysis End Relative Day
derive_var_agegr_fda() derive_var_agegr_ema()
Derive Age Groups
derive_var_astdy()
Derive Analysis Start Relative Day
derive_var_atirel()
Derive Time Relative to Reference
derive_vars_merged_dt()
Merge a (Imputed) Date Variable
derive_vars_merged_dtm()
Merge a (Imputed) Datetime Variable
derive_vars_suppqual()
Join Supplementary Qualifier Variables into the Parent SDTM Domain