# Create Common TLGs Used in Clinical Trials

## Documentation for package ‘tern’ version 0.8.4

- DESCRIPTION file.
- User guides, package vignettes and other documentation.

## Help Pages

A C D E F G H I K L M O P R S T U misc

tern-package | tern Package

## -- A --

add_rowcounts | Layout Creating Function to Add Row Total Counts
aesi_label | Labels for Adverse Event Baskets
analyze_colvars_functions | Analyze Functions on Columns
analyze_functions | Analyze Functions
analyze_num_patients | Number of Patients
analyze_vars_in_cols | Summary numeric variables in columns
append_varlabels | Add Variable Labels to Top Left Corner in Table
arrange_grobs | Arrange Multiple Grobs
as.rtable | Convert to 'rtable'
as.rtable.data.frame | Convert to 'rtable'
a_compare | Compare Variables Between Groups
a_compare.character | Compare Variables Between Groups
a_compare.factor | Compare Variables Between Groups
a_compare.logical | Compare Variables Between Groups
a_compare.numeric | Compare Variables Between Groups
a_count_occurrences | Occurrence Counts
a_count_occurrences_by_grade | Occurrence Counts by Grade
a_count_patients_with_event | Count the Number of Patients with a Particular Event
a_count_patients_with_flags | Count the Number of Patients with Particular Flags
a_count_values | Counting Specific Values
a_coxreg | Cox Proportional Hazards Regression
a_length_proportion | Estimation of Proportions per Level of Factor
a_odds_ratio | Odds Ratio Estimation
a_proportion | Estimation of Proportions
a_proportion_diff | Proportion Difference
a_summary | Summarize Variables
a_summary.character | Summarize Variables
a_summary.factor | Summarize Variables
a_summary.logical | Summarize Variables
a_summary.numeric | Summarize Variables

## -- C --

CombinationFunction | Combination Functions Class
CombinationFunction-class | Combination Functions Class
combination_function | Combination Functions Class
combine_counts | Combine Counts
combine_groups | Reference and Treatment Group Combination
combine_levels | Combine Factor Levels
combine_vectors | Combine Two Vectors Element Wise
compare_variables | Compare Variables Between Groups
compare_vars | Compare Variables Between Groups
control_coxph | Control Function for 'CoxPH' Model
control_coxreg | Controls for Cox Regression
control_incidence_rate | Control function for incidence rate
control_lineplot_vars | Control Function for 'g_lineplot' Function
control_logistic | Control Function for Logistic Regression Model Fitting
control_step | Control Function for Subgroup Treatment Effect Pattern (STEP) Calculations
control_summarize_vars | Control Function for Descriptive Statistics
control_surv_time | Control Function for 'survfit' Model for Survival Time
control_surv_timepoint | Control Function for 'survfit' Model for Patient's Survival Rate at time point
count_occurrences | Occurrence Counts
count_occurrences_by_grade | Occurrence Counts by Grade
count_patients_with_event | Count the Number of Patients with a Particular Event
count_patients_with_flags | Count the Number of Patients with Particular Flags
count_values | Counting Specific Values
count_values_funs | Counting Specific Values
cox_regression | Cox Proportional Hazards Regression
cox_regression_inter | Cox Regression Helper: Interactions
create_afun_compare | Constructor Function for 'compare_vars()'
create_afun_summary | Constructor Function for 'summarize_vars()' and 'summarize_colvars()'
cut_quantile_bins | Cutting Numeric Vector into Empirical Quantile Bins

## -- D --

day2month | Conversion of Days to Months
decorate_grob | Add Titles, Footnotes, Page Number, and a Bounding Box to a Grid Grob
decorate_grob_set | Decorate Set of 'grobs' and Add Page Numbering
df_explicit_na | Encode Categorical Missing Values in a Data Frame
draw_grob | Draw 'grob'
d_count_abnormal_by_baseline | Description Function for 's_count_abnormal_by_baseline()'
d_count_cumulative | Description of Cumulative Count
d_count_missed_doses | Description Function that Calculates Labels for 's_count_missed_doses()'.
d_onco_rsp_label | Description of Standard Oncology Response
d_pkparam | Generate PK reference dataset
d_proportion | Description of the Proportion Summary
d_proportion_diff | Description of Method Used for Proportion Comparison
d_rsp_subgroups_colvars | Labels for Column Variables in Binary Response by Subgroup Table
d_survival_subgroups_colvars | Labels for Column Variables in Survival Duration by Subgroup Table
d_test_proportion_diff | Description of the Difference Test Between Two Proportions

## -- E --

estimate_multinomial_response | Estimation of Proportions per Level of Factor
estimate_multinomial_rsp | Estimation of Proportions per Level of Factor
estimate_odds_ratio | Odds Ratio Estimation
estimate_proportion | Estimation of Proportions
estimate_proportions | Estimation of Proportions
estimate_proportion_diff | Proportion Difference
explicit_na | Missing Data
extract_rsp_biomarkers | Prepares Response Data Estimates for Multiple Biomarkers in a Single Data Frame
extract_rsp_subgroups | Prepares Response Data for Population Subgroups in Data Frames
extract_survival_biomarkers | Prepares Survival Data Estimates for Multiple Biomarkers in a Single Data Frame
extract_survival_subgroups | Prepares Survival Data for Population Subgroups in Data Frames
extreme_format | Formatting Extreme Values
ex_data | Simulated 'CDISC' Data for Examples

## -- F --

fct_collapse_only | Collapsing of Factor Levels and Keeping Only Those New Group Levels
fct_discard | Discard Certain Levels from a Factor
fct_explicit_na_if | Insertion of Explicit Missings in a Factor
fit_coxreg | Fits for Cox Proportional Hazards Regression
fit_coxreg_multivar | Fits for Cox Proportional Hazards Regression
fit_coxreg_univar | Fits for Cox Proportional Hazards Regression
fit_logistic | Fit for Logistic Regression
fit_rsp_step | Subgroup Treatment Effect Pattern (STEP) Fit for Binary (Response) Outcome
fit_survival_step | Subgroup Treatment Effect Pattern (STEP) Fit for Survival Outcome
forest_viewport | Create a Viewport Tree for the Forest Plot
formatting_functions | Formatting Functions
format_count_fraction | Formatting Count and Fraction
format_count_fraction_fixed_dp | Formatting Count and Percentage with Fixed Single Decimal Place
format_extreme_values | Formatting a Single Extreme Value
format_extreme_values_ci | Formatting Extreme Values Part of a Confidence Interval
format_fraction | Formatting Fraction and Percentage
format_fraction_fixed_dp | Formatting Fraction and Percentage with Fixed Single Decimal Place
format_fraction_threshold | Formatting Fraction with Lower Threshold
format_xx | Formatting: XX as Formatting Function
f_conf_level | Utility function to create label for confidence interval
f_pval | Utility function to create label for p-value

## -- G --

get_smooths | Smooth Function with Optional Grouping
groups_list_to_df | Convert List of Groups to Data Frame
g_forest | Create a Forest Plot based on a Table
g_ipp | Individual Patient Plots
g_km | Kaplan-Meier Plot
g_lineplot | Line plot with the optional table
g_step | Create a STEP Graph
g_waterfall | Horizontal Waterfall Plot

## -- H --

has_counts_difference | Occurrence Table Pruning
has_count_in_any_col | Occurrence Table Pruning
has_count_in_cols | Occurrence Table Pruning
has_fractions_difference | Occurrence Table Pruning
has_fraction_in_any_col | Occurrence Table Pruning
has_fraction_in_cols | Occurrence Table Pruning
h_adlb_worsen | Helper Function to Prepare 'ADLB' with Worst Labs
h_adsl_adlb_merge_using_worst_flag | Helper Function for Deriving Analysis Datasets for 'LBT13' and 'LBT14'
h_ancova | Helper Function to Return Results of a Linear Model
h_append_grade_groups | Helper function for 's_count_occurrences_by_grade()'
h_col_indices | Obtain Column Indices
h_count_cumulative | Helper Function for 's_count_cumulative()'
h_coxph_df | Helper Functions for Tabulating Survival Duration by Subgroup
h_coxph_subgroups_df | Helper Functions for Tabulating Survival Duration by Subgroup
h_coxreg_extract_interaction | Cox Regression Helper: Interactions
h_coxreg_inter_effect | Cox Regression Helper: Interactions
h_coxreg_inter_effect.character | Cox Regression Helper: Interactions
h_coxreg_inter_effect.factor | Cox Regression Helper: Interactions
h_coxreg_inter_effect.numeric | Cox Regression Helper: Interactions
h_coxreg_inter_estimations | Cox Regression Helper: Interactions
h_coxreg_multivar_extract | Helper Functions for Cox Proportional Hazards Regression
h_coxreg_multivar_formula | Helper Functions for Cox Proportional Hazards Regression
h_coxreg_mult_cont_df | Helper Functions for Tabulating Biomarker Effects on Survival by Subgroup
h_coxreg_univar_extract | Helper Functions for Cox Proportional Hazards Regression
h_coxreg_univar_formulas | Helper Functions for Cox Proportional Hazards Regression
h_cox_regression | Helper Functions for Cox Proportional Hazards Regression
h_data_plot | Helper function: tidy survival fit
h_decompose_gg | 'ggplot' Decomposition
h_format_row | Helper function to get the right formatting in the optional table in 'g_lineplot'.
h_format_threshold | Formatting Extreme Values
h_get_format_threshold | Formatting Extreme Values
h_get_interaction_vars | Helper Functions for Multivariate Logistic Regression
h_ggkm | Helper function: KM plot
h_glm_interaction_extract | Helper Functions for Multivariate Logistic Regression
h_glm_inter_term_extract | Helper Functions for Multivariate Logistic Regression
h_glm_simple_term_extract | Helper Functions for Multivariate Logistic Regression
h_grob_coxph | Helper Function: 'CoxPH' Grob
h_grob_median_surv | Helper Function: Survival Estimation Grob
h_grob_tbl_at_risk | Helper: Patient-at-Risk Grobs
h_grob_y_annot | Helper: Grid Object with y-axis Annotation
h_g_ipp | Helper Function To Create Simple Line Plot over Time
h_interaction_coef_name | Helper Functions for Multivariate Logistic Regression
h_interaction_term_labels | Helper Functions for Multivariate Logistic Regression
h_km_layout | Helper: KM Layout
h_logistic_inter_terms | Helper Functions for Multivariate Logistic Regression
h_logistic_mult_cont_df | Helper Functions for Tabulating Biomarker Effects on Binary Response by Subgroup
h_logistic_regression | Helper Functions for Multivariate Logistic Regression
h_logistic_simple_terms | Helper Functions for Multivariate Logistic Regression
h_map_for_count_abnormal | Helper Function to create a map dataframe that can be used in 'trim_levels_to_map' split function.
h_odds_ratio | Helper Functions for Odds Ratio Estimation
h_odds_ratio_df | Helper Functions for Tabulating Binary Response by Subgroup
h_odds_ratio_subgroups_df | Helper Functions for Tabulating Binary Response by Subgroup
h_or_cat_interaction | Helper Functions for Multivariate Logistic Regression
h_or_cont_interaction | Helper Functions for Multivariate Logistic Regression
h_or_interaction | Helper Functions for Multivariate Logistic Regression
h_pkparam_sort | Sort Data by PK PARAM Variable
h_proportions | Helper Functions for Calculating Proportion Confidence Intervals
h_proportion_df | Helper Functions for Tabulating Binary Response by Subgroup
h_proportion_subgroups_df | Helper Functions for Tabulating Binary Response by Subgroup
h_prop_diff | Helper Functions to Calculate Proportion Difference
h_response_biomarkers_subgroups | Helper Functions for Tabulating Biomarker Effects on Binary Response by Subgroup
h_response_subgroups | Helper Functions for Tabulating Binary Response by Subgroup
h_rsp_to_logistic_variables | Helper Functions for Tabulating Biomarker Effects on Binary Response by Subgroup
h_simple_term_labels | Helper Functions for Multivariate Logistic Regression
h_split_by_subgroups | Split Dataframe by Subgroups
h_split_param | Split parameters
h_stack_by_baskets | Helper Function to create a new 'SMQ' variable in 'ADAE' by stacking 'SMQ' and/or 'CQ' records.
h_step | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_step_rsp_est | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_step_rsp_formula | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_step_survival_est | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_step_survival_formula | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_step_trt_effect | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_step_window | Helper Functions for Subgroup Treatment Effect Pattern (STEP) Calculations
h_survival_biomarkers_subgroups | Helper Functions for Tabulating Biomarker Effects on Survival by Subgroup
h_survival_duration_subgroups | Helper Functions for Tabulating Survival Duration by Subgroup
h_survtime_df | Helper Functions for Tabulating Survival Duration by Subgroup
h_survtime_subgroups_df | Helper Functions for Tabulating Survival Duration by Subgroup
h_surv_to_coxreg_variables | Helper Functions for Tabulating Biomarker Effects on Survival by Subgroup
h_tab_one_biomarker | Helper Function for Tabulation of a Single Biomarker Result
h_tab_rsp_one_biomarker | Helper Functions for Tabulating Biomarker Effects on Binary Response by Subgroup
h_tab_surv_one_biomarker | Helper Functions for Tabulating Biomarker Effects on Survival by Subgroup
h_tbl_coxph_pairwise | Helper Function: Pairwise 'CoxPH' table
h_tbl_median_surv | Helper Function: Survival Estimations
h_worsen_counter | Helper Function to Analyze Patients for 's_count_abnormal_lab_worsen_by_baseline()'
h_xticks | Helper function: x tick positions

## -- I --

individual_patient_plot | Individual Patient Plots

## -- K --

keep_content_rows | Occurrence Table Pruning
keep_rows | Occurrence Table Pruning

## -- L --

logistic_regression_cols | Logistic Regression Multivariate Column Layout Function
logistic_summary_by_flag | Logistic Regression Summary Table Constructor Function

## -- M --

month2day | Conversion of Months to Days

## -- O --

odds_ratio | Odds Ratio Estimation
or_clogit | Helper Functions for Odds Ratio Estimation
or_glm | Helper Functions for Odds Ratio Estimation

## -- P --

prop_agresti_coull | Helper Functions for Calculating Proportion Confidence Intervals
prop_clopper_pearson | Helper Functions for Calculating Proportion Confidence Intervals
prop_diff | Proportion Difference
prop_diff_cmh | Helper Functions to Calculate Proportion Difference
prop_diff_ha | Helper Functions to Calculate Proportion Difference
prop_diff_nc | Helper Functions to Calculate Proportion Difference
prop_diff_strat_nc | Helper Functions to Calculate Proportion Difference
prop_diff_wald | Helper Functions to Calculate Proportion Difference
prop_jeffreys | Helper Functions for Calculating Proportion Confidence Intervals
prop_strat_wilson | Helper Functions for Calculating Proportion Confidence Intervals
prop_wald | Helper Functions for Calculating Proportion Confidence Intervals
prop_wilson | Helper Functions for Calculating Proportion Confidence Intervals
prune_occurrences | Occurrence Table Pruning

## -- R --

reapply_varlabels | Reapply Variable Labels
response_biomarkers_subgroups | Tabulate Biomarker Effects on Binary Response by Subgroup

## -- S --

sas_na | Convert Strings to 'NA'
score_occurrences | Occurrence Table Sorting
score_occurrences_cols | Occurrence Table Sorting
score_occurrences_cont_cols | Occurrence Table Sorting
score_occurrences_subtable | Occurrence Table Sorting
split_cols_by_groups | Split Columns by Groups of Levels
stack_grobs | Stack Multiple Grobs
stat_mean_ci | Confidence Interval for Mean
stat_mean_pval | p-Value of the Mean
stat_median_ci | Confidence Interval for Median
strata_normal_quantile | Helper Function for the Estimation of Stratified Quantiles
summarize_colvars | Summarize Variables in Columns
summarize_coxreg | Cox Proportional Hazards Regression
summarize_functions | Summarize Functions
summarize_logistic | Multivariate Logistic Regression Table
summarize_num_patients | Number of Patients
summarize_occurrences_by_grade | Occurrence Counts by Grade
summarize_variables | Summarize Variables
summarize_vars | Summarize Variables
survival_biomarkers_subgroups | Tabulate Biomarker Effects on Survival by Subgroup
s_compare | Compare Variables Between Groups
s_compare.character | Compare Variables Between Groups
s_compare.factor | Compare Variables Between Groups
s_compare.logical | Compare Variables Between Groups
s_compare.numeric | Compare Variables Between Groups
s_count_occurrences | Occurrence Counts
s_count_occurrences_by_grade | Occurrence Counts by Grade
s_count_patients_with_event | Count the Number of Patients with a Particular Event
s_count_patients_with_flags | Count the Number of Patients with Particular Flags
s_count_values | Counting Specific Values
s_count_values.character | Counting Specific Values
s_count_values.factor | Counting Specific Values
s_count_values.logical | Counting Specific Values
s_coxreg | Cox Proportional Hazards Regression
s_length_proportion | Estimation of Proportions per Level of Factor
s_num_patients | Number of Patients
s_num_patients_content | Number of Patients
s_odds_ratio | Odds Ratio Estimation
s_proportion | Estimation of Proportions
s_proportion_diff | Proportion Difference
s_summary | Summarize Variables
s_summary.character | Summarize Variables
s_summary.factor | Summarize Variables
s_summary.logical | Summarize Variables
s_summary.numeric | Summarize Variables

## -- T --

tabulate_rsp_biomarkers | Tabulate Biomarker Effects on Binary Response by Subgroup
tabulate_survival_biomarkers | Tabulate Biomarker Effects on Survival by Subgroup
tern | tern Package
tern_ex_adae | Simulated 'CDISC' Data for Examples
tern_ex_adlb | Simulated 'CDISC' Data for Examples
tern_ex_adpp | Simulated 'CDISC' Data for Examples
tern_ex_adrs | Simulated 'CDISC' Data for Examples
tern_ex_adsl | Simulated 'CDISC' Data for Examples
tern_ex_adtte | Simulated 'CDISC' Data for Examples
tidy.coxreg.multivar | Custom Tidy Methods for Cox Regression
tidy.coxreg.univar | Custom Tidy Methods for Cox Regression
tidy.glm | Custom Tidy Method for Binomial GLM Results
tidy.step | Custom Tidy Method for STEP Results
tidy.summary.coxph | Custom Tidy Methods for Cox Regression
tidy_coxreg | Custom Tidy Methods for Cox Regression
to_n | Replicate Entries of a Vector if Required
to_string_matrix | Convert Table into Matrix of Strings

## -- U --

univariate | Univariate Formula Special Term
update_weights_strat_wilson | Helper Function for the Estimation of Weights for 'prop_strat_wilson'

## -- misc --

!-method | Combination Functions Class
&-method | Combination Functions Class
|-method | Combination Functions Class