Skip to contents

Derivations for Adding Variables

All ADaMs

derive_var_extreme_flag()
Add a Variable Flagging the First or Last Observation Within Each By Group
derive_var_joined_exist_flag()
Derives a Flag Based on an Existing Flag
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_merged_summary()
Merge a Summary Variable
derive_var_obs_number()
Adds a Variable Numbering the Observations Within Each By Group
derive_var_relative_flag()
Flag Observations Before or After a Condition is Fulfilled
derive_var_trtdurd()
Derive Total Treatment Duration (Days)
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_joined()
Add Variables from an Additional Dataset Based on Conditions from Both Datasets
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_dthcaus()
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_period()
Add Subperiod, Period, or Phase Variables to ADSL

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)

derive_var_trtemfl()
Derive Treatment-emergent Flag
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_expected_records()
Derive Expected Records
derive_extreme_event()
Add the Worst or Best Observation for Each By Group as New Records
derive_extreme_records()
Add the First or Last Observation for Each By Group as New Records
derive_locf_records()
Derive LOCF (Last Observation Carried Forward) 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_extreme_event()
Add an Extreme 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

Metadata

Auxiliary datasets providing definitions as input for derivations, e.g. grading criteria or dose frequencies

atoxgr_criteria_ctcv4
Metadata Holding Grading Criteria for NCI-CTCAEv4
atoxgr_criteria_ctcv5
Metadata Holding Grading Criteria for NCI-CTCAEv5
dose_freq_lookup
Pre-Defined Dose Frequencies

Advanced Functions

Admiral Options

get_admiral_option()
Get the Value of an Admiral Option
set_admiral_options()
Set the Value of Admiral Options

Higher Order

call_derivation()
Call a Single Derivation Multiple Times
derivation_slice()
Create a derivation_slice Object
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

Creating Auxiliary Datasets

consolidate_metadata()
Consolidate Multiple Meta Datasets Into a Single One
create_period_dataset()
Create a Reference Dataset for Subperiods, Periods, or Phases
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

Source Objects

basket_select()
Create a basket_select object
censor_source()
Create a censor_source Object
date_source()
Create a date_source object
dthcaus_source()
Create a dthcaus_source Object
event()
Create a event Object
event_source()
Create an event_source Object
query()
Create an query 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

Other

assert_db_requirements()
Check required parameters for a basket
assert_terms()
Asserts Requirements for Terms for Queries
assert_valid_queries()
Verify if a Dataset Has the Required Format as Queries Dataset.
extend_source_datasets()
Add By Groups to All Datasets if Necessary
filter_date_sources()
Select the First or Last Date from Several Sources
format(<basket_select>)
Returns a Character Representation of a basket_select() Object
list_tte_source_objects()
List all tte_source Objects Available in a Package
params()
Create a Set of Parameters
validate_basket_select()
Validate an object is indeed a basket_select object
validate_query()
Validate an object is indeed a query 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
compute_scale()
Compute Scale Parameters

Utility Functions

Utilities for Formatting Observations

convert_blanks_to_na()
Convert Blank Strings Into NAs
convert_na_to_blanks()
Convert NAs Into Blank Strings
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 Led 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_extreme()
Filter the First or Last Observation for Each By Group
filter_joined()
Filter Observations Taking Other Observations into Account
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 for Quosures

chr2vars()
Turn a Character Vector into a List of Expressions
negate_vars()
Negate List of Variables

Utilities used for Examples and Template Scripts

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

Utilities for Printing

print(<adam_templates>)
Print adam_templates Objects
print(<source>)
Print source Objects
print_named_list()
Print Named List

Example Datasets

You can run use_ad_template() to produce additional datasets

admiral_adlb
Lab Analysis Dataset
admiral_adsl
Subject Level Analysis Dataset
ex_single
Single Dose Exposure Dataset
example_qs
Example QS Dataset
queries
Queries Dataset
queries_mh
Queries MH Dataset

Objects exported from other packages

To maximize the user-friendliness of admiral, functions from other packages are provided without changes made to them, follow the links below to see their documentation.

`%>%`
Pipe operator
desc
dplyr desc
exprs
rlang exprs

Deprecated

As admiral is still evolving, functions/parameters may need to be removed or replaced over time. In such cases, the function/parameter will enter the following 6-month deprecation cycle:

  • In the first release (0-3 months), there will be a warning issued if you use the function/parameter, but it will still be available to use.
  • In the following release (3-6 months), an error will be produced if you use the function/parameter.
  • Finally, from the 3rd release (6 months) onwards, the function/parameter will be removed from admiral and its documentation completely.

Note: Guidance on replacement functionality can be found in the warning/error message produced or in the function’s documentation.

Below, you can find a list of functions in the process of being deprecated:

derive_var_confirmation_flag()
Derive Confirmation Flag
derive_var_disposition_status()
Derive a Disposition Status at a Specific Timepoint
derive_var_worst_flag()
Adds a Variable Flagging the Maximal / Minimal Value Within a Group of Observations
derive_vars_disposition_reason()
Derive a Disposition Reason at a Specific Timepoint
format_eoxxstt_default()
Default Format for Disposition Status
format_reason_default()
Default Format for the Disposition Reason