diff --git a/NAMESPACE b/NAMESPACE index f1b461dae2..c6a85a85e3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -288,6 +288,7 @@ export(tabulate_survival_biomarkers) export(tabulate_survival_subgroups) export(tern_default_formats) export(tern_default_labels) +export(tern_default_stats) export(test_proportion_diff) export(to_n) export(to_string_matrix) diff --git a/NEWS.md b/NEWS.md index 522c9725e0..2cef17ef10 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,7 @@ * Added internal utility function `apply_auto_formatting` to check for `"auto"` formats and replace them with implementation of `format_auto` in analyze functions. * Added utility function `labels_use_control` to modify labels with control specifications. +* Added list containing default statistics for each method group, `tern_default_stats`. ### Enhancements * Added `ref_group_coxph` parameter to `g_km` to specify the reference group used for pairwise Cox-PH calculations when `annot_coxph = TRUE`. diff --git a/R/abnormal.R b/R/abnormal.R index ec337dd3ee..947fd93d59 100644 --- a/R/abnormal.R +++ b/R/abnormal.R @@ -13,6 +13,8 @@ #' @param abnormal (named `list`)\cr list identifying the abnormal range level(s) in `var`. Defaults to #' `list(Low = "LOW", High = "HIGH")` but you can also group different levels into the named list, #' for example, `abnormal = list(Low = c("LOW", "LOW LOW"), High = c("HIGH", "HIGH HIGH"))`. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal")` +#' to see available statistics for this function. #' #' @note #' * `count_abnormal()` only works with a single variable containing multiple abnormal levels. diff --git a/R/abnormal_by_baseline.R b/R/abnormal_by_baseline.R index b308a74162..191e1e8bec 100644 --- a/R/abnormal_by_baseline.R +++ b/R/abnormal_by_baseline.R @@ -18,6 +18,8 @@ #' #' @inheritParams argument_convention #' @param abnormal (`character`)\cr identifying the abnormal range level(s) in `.var`. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_baseline")` +#' to see available statistics for this function. #' #' @note #' * `df` should be filtered to include only post-baseline records. diff --git a/R/abnormal_by_marked.R b/R/abnormal_by_marked.R index ffcaee38ba..c2bf670215 100644 --- a/R/abnormal_by_marked.R +++ b/R/abnormal_by_marked.R @@ -14,6 +14,8 @@ #' @inheritParams argument_convention #' @param category (`list`)\cr with different marked category names for single #' and last or replicated. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_marked")` +#' to see available statistics for this function. #' #' @note `Single, not last` and `Last or replicated` levels are mutually exclusive. If a patient has #' abnormalities that meet both the `Single, not last` and `Last or replicated` criteria, then the diff --git a/R/abnormal_by_worst_grade.R b/R/abnormal_by_worst_grade.R index d6f7ee59fc..e4deb22784 100644 --- a/R/abnormal_by_worst_grade.R +++ b/R/abnormal_by_worst_grade.R @@ -12,6 +12,8 @@ #' * `Any`: Numerator is number of patients with at least one abnormality, which means grade is different from 0. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_worst_grade")` +#' to see available statistics for this function. #' #' @details The pre-processing steps are crucial when using this function. From the standard lab grade variable #' `ATOXGR`, derive the following two variables: diff --git a/R/abnormal_by_worst_grade_worsen.R b/R/abnormal_by_worst_grade_worsen.R index 120dc107a2..8c47944ce7 100644 --- a/R/abnormal_by_worst_grade_worsen.R +++ b/R/abnormal_by_worst_grade_worsen.R @@ -5,6 +5,8 @@ #' Patient count and fraction for laboratory events (worsen from baseline) shift table. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_worst_grade_worsen")` +#' to see all available statistics. #' #' @seealso Relevant helper functions [h_adlb_worsen()] and [h_worsen_counter()] #' diff --git a/R/analyze_variables.R b/R/analyze_variables.R index ac80394beb..d848a3bed1 100644 --- a/R/analyze_variables.R +++ b/R/analyze_variables.R @@ -46,6 +46,9 @@ control_summarize_vars <- control_analyze_vars #' functions; in this case [rtables::analyze()]. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("analyze_vars_numeric")` to see +#' statistics available for numeric variables, and `get_stats("analyze_vars_counts")` for statistics available +#' for non-numeric variables. #' #' @name analyze_variables NULL diff --git a/R/compare_variables.R b/R/compare_variables.R index e82eda8459..20b8deb3d1 100644 --- a/R/compare_variables.R +++ b/R/compare_variables.R @@ -5,6 +5,9 @@ #' Comparison with a reference group for different `x` objects. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("analyze_vars_numeric")` to see +#' statistics available for numeric variables, and `get_stats("analyze_vars_counts")` for statistics available +#' for non-numeric variables. #' #' @note #' * For factor variables, `denom` for factor proportions can only be `n` since the purpose is to compare proportions diff --git a/R/count_cumulative.R b/R/count_cumulative.R index 4f94ba5d86..3928560dab 100644 --- a/R/count_cumulative.R +++ b/R/count_cumulative.R @@ -7,6 +7,8 @@ #' #' @inheritParams h_count_cumulative #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_cumulative")` +#' to see available statistics for this function. #' #' @seealso Relevant helper function [h_count_cumulative()], and descriptive function [d_count_cumulative()]. #' diff --git a/R/count_missed_doses.R b/R/count_missed_doses.R index 735acb5460..55f57dcd9f 100644 --- a/R/count_missed_doses.R +++ b/R/count_missed_doses.R @@ -6,6 +6,8 @@ #' mainly the special labels. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_missed_doses")` +#' to see available statistics for this function. #' #' @seealso Relevant description function [d_count_missed_doses()]. #' diff --git a/R/count_occurrences.R b/R/count_occurrences.R index ba95064776..bf16d71921 100644 --- a/R/count_occurrences.R +++ b/R/count_occurrences.R @@ -8,6 +8,8 @@ #' counted only once. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_occurrences")` +#' to see available statistics for this function. #' #' @note By default, occurrences which don't appear in a given row split are dropped from the table and #' the occurrences in the table are sorted alphabetically per row split. Therefore, the corresponding layout diff --git a/R/count_occurrences_by_grade.R b/R/count_occurrences_by_grade.R index 9b67fc7278..785aff4256 100644 --- a/R/count_occurrences_by_grade.R +++ b/R/count_occurrences_by_grade.R @@ -10,6 +10,8 @@ #' @param grade_groups (named `list` of `character`)\cr containing groupings of grades. #' @param remove_single (`logical`)\cr `TRUE` to not include the elements of one-element grade groups #' in the the output list; in this case only the grade groups names will be included in the output. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_occurrences_by_grade")` +#' to see available statistics for this function. #' #' @seealso Relevant helper function [h_append_grade_groups()]. #' diff --git a/R/count_patients_events_in_cols.R b/R/count_patients_events_in_cols.R index 5eb601aaf4..135e0018d4 100644 --- a/R/count_patients_events_in_cols.R +++ b/R/count_patients_events_in_cols.R @@ -6,6 +6,9 @@ #' when a column table layout is required. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run +#' `get_stats("summarize_patients_events_in_cols")` to see available statistics for this function, in addition to any +#' added using `filters_list`. #' #' @name count_patients_events_in_cols NULL diff --git a/R/count_patients_with_event.R b/R/count_patients_with_event.R index 92cc42edba..9b6d1bc91e 100644 --- a/R/count_patients_with_event.R +++ b/R/count_patients_with_event.R @@ -5,6 +5,8 @@ #' The primary analysis variable `.var` denotes the unique patient identifier. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_patients_with_event")` +#' to see available statistics for this function. #' #' @seealso [count_patients_with_flags] #' diff --git a/R/count_patients_with_flags.R b/R/count_patients_with_flags.R index e7580b34cf..1b3edf3354 100644 --- a/R/count_patients_with_flags.R +++ b/R/count_patients_with_flags.R @@ -5,6 +5,8 @@ #' The primary analysis variable `.var` denotes the unique patient identifier. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_patients_with_flags")` +#' to see available statistics for this function. #' #' @seealso [count_patients_with_event] #' diff --git a/R/count_values.R b/R/count_values.R index ebbf8068dd..428e80159a 100644 --- a/R/count_values.R +++ b/R/count_values.R @@ -5,6 +5,8 @@ #' We can count the occurrence of specific values in a variable of interest. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_values")` +#' to see available statistics for this function. #' #' @note #' * For `factor` variables, `s_count_values` checks whether `values` are all included in the levels of `x` diff --git a/R/estimate_multinomial_rsp.R b/R/estimate_multinomial_rsp.R index fb3fafff16..5c003ffd26 100644 --- a/R/estimate_multinomial_rsp.R +++ b/R/estimate_multinomial_rsp.R @@ -6,6 +6,8 @@ #' regarding the level of a factor. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_multinomial_response")` +#' to see available statistics for this function. #' #' @seealso Relevant description function [d_onco_rsp_label()]. #' diff --git a/R/estimate_proportion.R b/R/estimate_proportion.R index d7d88f1525..8552aaab8d 100644 --- a/R/estimate_proportion.R +++ b/R/estimate_proportion.R @@ -5,6 +5,8 @@ #' Estimate the proportion of responders within a studied population. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_proportion")` +#' to see available statistics for this function. #' #' @seealso [h_proportions] #' diff --git a/R/incidence_rate.R b/R/incidence_rate.R index ddf0410ebc..91c8946021 100644 --- a/R/incidence_rate.R +++ b/R/incidence_rate.R @@ -15,6 +15,8 @@ #' indicating time unit for data input. #' * `num_pt_year` (`numeric`)\cr time unit for desired output (in person-years). #' @param n_events (`integer`)\cr number of events observed. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_incidence_rate")` +#' to see available statistics for this function. #' #' @seealso [control_incidence_rate()] and helper functions [h_incidence_rate]. #' diff --git a/R/odds_ratio.R b/R/odds_ratio.R index dac3c1cba7..cc9ea9754f 100644 --- a/R/odds_ratio.R +++ b/R/odds_ratio.R @@ -6,6 +6,8 @@ #' along with a confidence interval. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_odds_ratio")` +#' to see available statistics for this function. #' #' @details This function uses either logistic regression for unstratified #' analyses, or conditional logistic regression for stratified analyses. diff --git a/R/prop_diff.R b/R/prop_diff.R index 27a27c8c06..b82ac4ff1a 100644 --- a/R/prop_diff.R +++ b/R/prop_diff.R @@ -3,6 +3,8 @@ #' @description `r lifecycle::badge("stable")` #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_proportion_diff")` +#' to see available statistics for this function. #' #' @seealso [d_proportion_diff()] #' diff --git a/R/prop_diff_test.R b/R/prop_diff_test.R index c8b65343f9..2f77dfabd5 100644 --- a/R/prop_diff_test.R +++ b/R/prop_diff_test.R @@ -5,6 +5,8 @@ #' Various tests were implemented to test the difference between two proportions. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("test_proportion_diff")` +#' to see available statistics for this function. #' #' @seealso [h_prop_diff_test] #' diff --git a/R/response_biomarkers_subgroups.R b/R/response_biomarkers_subgroups.R index e66fc32f4e..b22034b894 100644 --- a/R/response_biomarkers_subgroups.R +++ b/R/response_biomarkers_subgroups.R @@ -72,7 +72,7 @@ tabulate_rsp_biomarkers <- function(df, checkmate::assert_data_frame(df) checkmate::assert_character(df$biomarker) checkmate::assert_character(df$biomarker_label) - checkmate::assert_subset(vars, c("n_tot", "n_rsp", "prop", "or", "ci", "pval")) + checkmate::assert_subset(vars, get_stats("tabulate_rsp_biomarkers")) df_subs <- split(df, f = df$biomarker) tabs <- lapply(df_subs, FUN = function(df_sub) { diff --git a/R/summarize_ancova.R b/R/summarize_ancova.R index 8af0627940..6033c88aa9 100644 --- a/R/summarize_ancova.R +++ b/R/summarize_ancova.R @@ -6,6 +6,8 @@ #' multiple timepoints within the same response variable `.var`. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_ancova")` +#' to see available statistics for this function. #' #' @name summarize_ancova NULL diff --git a/R/summarize_change.R b/R/summarize_change.R index 0c3d66a217..a57c9a46aa 100644 --- a/R/summarize_change.R +++ b/R/summarize_change.R @@ -8,6 +8,8 @@ #' or the change from baseline values (post-baseline) are then summarized. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("analyze_vars_numeric)` +#' to see available statistics for this function. #' #' @name summarize_change NULL diff --git a/R/summarize_coxreg.R b/R/summarize_coxreg.R index 0e19cdb554..a0f112c935 100644 --- a/R/summarize_coxreg.R +++ b/R/summarize_coxreg.R @@ -5,6 +5,8 @@ #' Fits a Cox regression model and estimates hazard ratio to describe the effect size in a survival analysis. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_coxreg")` +#' to see available statistics for this function. #' #' @details Cox models are the most commonly used methods to estimate the magnitude of #' the effect in survival analysis. It assumes proportional hazards: the ratio diff --git a/R/summarize_glm_count.R b/R/summarize_glm_count.R index ca6544e950..2d03024d53 100644 --- a/R/summarize_glm_count.R +++ b/R/summarize_glm_count.R @@ -6,6 +6,8 @@ #' This can be used to analyze count and/or frequency data using a linear model. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_glm_count")` +#' to see available statistics for this function. #' #' @name summarize_glm_count NULL diff --git a/R/summarize_num_patients.R b/R/summarize_num_patients.R index 8883eb2f1b..01f3644d28 100644 --- a/R/summarize_num_patients.R +++ b/R/summarize_num_patients.R @@ -10,6 +10,8 @@ #' `nonunique` records. #' @param unique_count_suffix (`logical`)\cr should `"(n)"` suffix be added to `unique_count` labels. #' Defaults to `TRUE`. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_num_patients")` +#' to see available statistics for this function. #' #' @name summarize_num_patients NULL diff --git a/R/summarize_patients_exposure_in_cols.R b/R/summarize_patients_exposure_in_cols.R index d83672db3a..5ad66ba14d 100644 --- a/R/summarize_patients_exposure_in_cols.R +++ b/R/summarize_patients_exposure_in_cols.R @@ -6,6 +6,8 @@ #' when a column table layout is required. #' #' @inheritParams argument_convention +#' @param .stats (`character`)\cr statistics to select for the table. Run +#' `get_stats("analyze_patients_exposure_in_cols")` to see available statistics for this function. #' #' @name summarize_patients_exposure_in_cols NULL diff --git a/R/survival_biomarkers_subgroups.R b/R/survival_biomarkers_subgroups.R index b3bfc67ed7..3c59f0204f 100644 --- a/R/survival_biomarkers_subgroups.R +++ b/R/survival_biomarkers_subgroups.R @@ -213,7 +213,7 @@ tabulate_survival_biomarkers <- function(df, checkmate::assert_data_frame(df) checkmate::assert_character(df$biomarker) checkmate::assert_character(df$biomarker_label) - checkmate::assert_subset(vars, c("n_tot", "n_tot_events", "median", "hr", "ci", "pval")) + checkmate::assert_subset(vars, get_stats("tabulate_survival_biomarkers")) df_subs <- split(df, f = df$biomarker) tabs <- lapply(df_subs, FUN = function(df_sub) { diff --git a/R/survival_coxph_pairwise.R b/R/survival_coxph_pairwise.R index bdf9092fe1..3c4b682eaa 100644 --- a/R/survival_coxph_pairwise.R +++ b/R/survival_coxph_pairwise.R @@ -14,6 +14,8 @@ #' * `ties` (`string`)\cr specifying the method for tie handling. Default is `"efron"`, #' can also be set to `"breslow"` or `"exact"`. See more in [survival::coxph()] #' * `conf_level` (`proportion`)\cr confidence level of the interval for HR. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("coxph_pairwise")` +#' to see available statistics for this function. #' #' @name survival_coxph_pairwise NULL diff --git a/R/survival_time.R b/R/survival_time.R index e7d96d1d47..7457e5eab2 100644 --- a/R/survival_time.R +++ b/R/survival_time.R @@ -12,6 +12,8 @@ #' * `conf_type` (`string`)\cr confidence interval type. Options are "plain" (default), "log", or "log-log", #' see more in [survival::survfit()]. Note option "none" is not supported. #' * `quantiles` (`numeric`)\cr vector of length two to specify the quantiles of survival time. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("surv_time")` +#' to see available statistics for this function. #' #' @name survival_time NULL diff --git a/R/survival_timepoint.R b/R/survival_timepoint.R index e32fda1113..4f42239d2f 100644 --- a/R/survival_timepoint.R +++ b/R/survival_timepoint.R @@ -13,6 +13,8 @@ #' * `conf_type` (`string`)\cr confidence interval type. Options are "plain" (default), "log", "log-log", #' see more in [survival::survfit()]. Note option "none" is no longer supported. #' * `time_point` (`number`)\cr survival time point of interest. +#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("surv_timepoint")` +#' to see available statistics for this function. #' #' @name survival_timepoint NULL diff --git a/R/utils_default_stats_formats_labels.R b/R/utils_default_stats_formats_labels.R index 7447f4d6e2..7bb04c5a00 100644 --- a/R/utils_default_stats_formats_labels.R +++ b/R/utils_default_stats_formats_labels.R @@ -1,13 +1,13 @@ -#' Defaults for statistical method names and their associated formats & labels +#' Get default statistical methods and their associated formats, labels, and indent modifiers #' #' @description `r lifecycle::badge("experimental")` #' #' Utility functions to get valid statistic methods for different method groups -#' (`.stats`) and their associated formats (`.formats`) and labels (`.labels`). This utility -#' is used across `tern`, but some of its working principles can be seen in [analyze_vars()]. -#' See notes to understand why this is experimental. +#' (`.stats`) and their associated formats (`.formats`), labels (`.labels`), and indent modifiers +#' (`.indent_mods`). This utility is used across `tern`, but some of its working principles can be +#' seen in [analyze_vars()]. See notes to understand why this is experimental. #' -#' @param stats (`character`)\cr statistical methods to get defaults formats or labels for. +#' @param stats (`character`)\cr statistical methods to get defaults for. #' #' @details #' Current choices for `type` are `counts` and `numeric` for [analyze_vars()] and affect `get_stats()`. @@ -19,18 +19,18 @@ #' @name default_stats_formats_labels NULL -#' @describeIn default_stats_formats_labels Get defaults statistical methods for different -#' groups of methods. +#' @describeIn default_stats_formats_labels Get statistics available for a given method +#' group (analyze function). #' -#' @param method_groups (`character`)\cr indicates the group of statistical methods that -#' we need the defaults from. A character vector can be used to collect more than one group of statistical -#' methods. -#' @param stats_in (`character`)\cr desired stats to be picked out from the selected method group. -#' @param add_pval (`flag`)\cr should `"pval"` or `"pval_counts"` (if `method_groups` contains +#' @param method_groups (`character`)\cr indicates the statistical method group (`tern` analyze function) +#' to retrieve default statistics for. A character vector can be used to specify more than one statistical +#' method group. +#' @param stats_in (`character`)\cr statistics to retrieve for the selected method group. +#' @param add_pval (`flag`)\cr should `"pval"` (or `"pval_counts"` if `method_groups` contains #' `"analyze_vars_counts"`) be added to the statistical methods? #' #' @return -#' * `get_stats()` returns a character vector with all default statistical methods. +#' * `get_stats()` returns a `character` vector of statistical methods. #' #' @examples #' # analyze_vars is numeric @@ -66,21 +66,11 @@ get_stats <- function(method_groups = "analyze_vars_numeric", stats_in = NULL, a # Loop for multiple method groups for (mgi in method_groups) { - # Main switcher - out_tmp <- switch(mgi, - "count_occurrences" = c("count", "count_fraction", "count_fraction_fixed_dp", "fraction"), - "summarize_num_patients" = c("unique", "nonunique", "unique_count"), - "analyze_vars_counts" = c("n", "count", "count_fraction", "n_blq"), - "analyze_vars_numeric" = c( - "n", "sum", "mean", "sd", "se", "mean_sd", "mean_se", "mean_ci", "mean_sei", - "mean_sdi", "mean_pval", "median", "mad", "median_ci", "quantiles", "iqr", - "range", "min", "max", "median_range", "cv", "geom_mean", "geom_mean_ci", - "geom_cv" - ), - stop( - "The selected method group (", mgi, ") has no default statistical method." - ) - ) + out_tmp <- if (mgi %in% names(tern_default_stats)) { + tern_default_stats[[mgi]] + } else { + stop("The selected method group (", mgi, ") has no default statistical method.") + } out <- unique(c(out, out_tmp)) } @@ -131,14 +121,14 @@ get_stats <- function(method_groups = "analyze_vars_numeric", stats_in = NULL, a out } -#' @describeIn default_stats_formats_labels Get formats from vector of statistical methods. If not -#' present `NULL` is returned. +#' @describeIn default_stats_formats_labels Get formats corresponding to a list of statistics. #' #' @param formats_in (named `vector`) \cr inserted formats to replace defaults. It can be a #' character vector from [formatters::list_valid_format_labels()] or a custom format function. #' #' @return -#' * `get_formats_from_stats()` returns a named list of formats, they being a value from +#' * `get_formats_from_stats()` returns a named vector of formats (if present in either +#' `tern_default_formats` or `formats_in`, otherwise `NULL`). Values can be taken from #' [formatters::list_valid_format_labels()] or a custom function (e.g. [formatting_functions]). #' #' @note Formats in `tern` and `rtables` can be functions that take in the table cell value and @@ -187,9 +177,9 @@ get_formats_from_stats <- function(stats, formats_in = NULL) { out } -#' @describeIn default_stats_formats_labels Get labels from vector of statistical methods. +#' @describeIn default_stats_formats_labels Get labels corresponding to a list of statistics. #' -#' @param labels_in (named `vector`)\cr inserted labels to replace defaults. +#' @param labels_in (named `vector` of `character`)\cr inserted labels to replace defaults. #' @param row_nms (`character`)\cr row names. Levels of a `factor` or `character` variable, each #' of which the statistics in `.stats` will be calculated for. If this parameter is set, these #' variable levels will be used as the defaults, and the names of the given custom values should @@ -197,8 +187,8 @@ get_formats_from_stats <- function(stats, formats_in = NULL) { #' variable names if rows correspond to different variables instead of levels. Defaults to `NULL`. #' #' @return -#' * `get_labels_from_stats()` returns a named character vector of default labels (if present -#' otherwise `NULL`). +#' * `get_labels_from_stats()` returns a named `character` vector of labels (if present in either +#' `tern_default_labels` or `labels_in`, otherwise `NULL`). #' #' @examples #' # Defaults labels @@ -360,6 +350,53 @@ labels_use_control <- function(labels_default, control, labels_custom = NULL) { labels_default } +#' @describeIn default_stats_formats_labels Named list of available statistics by method group for `tern`. +#' +#' @format +#' * `tern_default_stats` is a named list of available statistics, with each element +#' named for their corresponding statistical method group. +#' +#' @export +tern_default_stats <- list( + abnormal = c("fraction"), + abnormal_by_baseline = c("fraction"), + abnormal_by_marked = c("count_fraction", "count_fraction_fixed_dp"), + abnormal_by_worst_grade = c("count_fraction", "count_fraction_fixed_dp"), + abnormal_by_worst_grade_worsen = c("fraction"), + analyze_patients_exposure_in_cols = c("n_patients", "sum_exposure"), + analyze_vars_counts = c("n", "count", "count_fraction", "count_fraction_fixed_dp", "n_blq"), + analyze_vars_numeric = c( + "n", "sum", "mean", "sd", "se", "mean_sd", "mean_se", "mean_ci", "mean_sei", "mean_sdi", "mean_pval", + "median", "mad", "median_ci", "quantiles", "iqr", "range", "min", "max", "median_range", "cv", + "geom_mean", "geom_mean_ci", "geom_cv" + ), + count_cumulative = c("count_fraction", "count_fraction_fixed_dp"), + count_missed_doses = c("n", "count_fraction", "count_fraction_fixed_dp"), + count_occurrences = c("count", "count_fraction", "count_fraction_fixed_dp", "fraction"), + count_occurrences_by_grade = c("count_fraction", "count_fraction_fixed_dp"), + count_patients_with_event = c("n", "count", "count_fraction", "count_fraction_fixed_dp", "n_blq"), + count_patients_with_flags = c("n", "count", "count_fraction", "count_fraction_fixed_dp", "n_blq"), + count_values = c("n", "count", "count_fraction", "count_fraction_fixed_dp", "n_blq"), + coxph_pairwise = c("pvalue", "hr", "hr_ci", "n_tot", "n_tot_events"), + estimate_incidence_rate = c("person_years", "n_events", "rate", "rate_ci"), + estimate_multinomial_response = c("n_prop", "prop_ci"), + estimate_odds_ratio = c("or_ci", "n_tot"), + estimate_proportion = c("n_prop", "prop_ci"), + estimate_proportion_diff = c("diff", "diff_ci"), + summarize_ancova = c("n", "lsmean", "lsmean_diff", "lsmean_diff_ci", "pval"), + summarize_coxreg = c("n", "hr", "ci", "pval", "pval_inter"), + summarize_glm_count = c("n", "rate", "rate_ci", "rate_ratio", "rate_ratio_ci", "pval"), + summarize_num_patients = c("unique", "nonunique", "unique_count"), + summarize_patients_events_in_cols = c("unique", "all"), + surv_time = c("median", "median_ci", "quantiles", "range_censor", "range_event", "range"), + surv_timepoint = c("pt_at_risk", "event_free_rate", "rate_se", "rate_ci", "rate_diff", "rate_diff_ci", "ztest_pval"), + tabulate_rsp_biomarkers = c("n_tot", "n_rsp", "prop", "or", "ci", "pval"), + tabulate_rsp_subgroups = c("n", "n_rsp", "prop", "n_tot", "or", "ci", "pval"), + tabulate_survival_biomarkers = c("n_tot", "n_tot_events", "median", "hr", "ci", "pval"), + tabulate_survival_subgroups = c("n_tot_events", "n_events", "n_tot", "n", "median", "hr", "ci", "pval"), + test_proportion_diff = c("pval") +) + #' @describeIn default_stats_formats_labels Named vector of default formats for `tern`. #' #' @format diff --git a/man/abnormal.Rd b/man/abnormal.Rd index 0e50726669..623676559a 100644 --- a/man/abnormal.Rd +++ b/man/abnormal.Rd @@ -64,7 +64,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("abnormal")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/abnormal_by_baseline.Rd b/man/abnormal_by_baseline.Rd index 312721849c..4c9cfa0462 100644 --- a/man/abnormal_by_baseline.Rd +++ b/man/abnormal_by_baseline.Rd @@ -65,7 +65,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("abnormal_by_baseline")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/abnormal_by_marked.Rd b/man/abnormal_by_marked.Rd index 73a2ca8e54..4129bf5f54 100644 --- a/man/abnormal_by_marked.Rd +++ b/man/abnormal_by_marked.Rd @@ -59,7 +59,8 @@ underneath analyses, which is not allowed.} \item{...}{additional arguments for the lower level functions.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("abnormal_by_marked")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/abnormal_by_worst_grade.Rd b/man/abnormal_by_worst_grade.Rd index e9afd5d467..04d01e6769 100644 --- a/man/abnormal_by_worst_grade.Rd +++ b/man/abnormal_by_worst_grade.Rd @@ -54,7 +54,8 @@ underneath analyses, which is not allowed.} \item{...}{additional arguments for the lower level functions.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("abnormal_by_worst_grade")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/abnormal_by_worst_grade_worsen.Rd b/man/abnormal_by_worst_grade_worsen.Rd index 6e6254c234..96db79332a 100644 --- a/man/abnormal_by_worst_grade_worsen.Rd +++ b/man/abnormal_by_worst_grade_worsen.Rd @@ -58,7 +58,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("abnormal_by_worst_grade_worsen")} +to see all available statistics.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/analyze_variables.Rd b/man/analyze_variables.Rd index 29cf623b9c..45f30d9a67 100644 --- a/man/analyze_variables.Rd +++ b/man/analyze_variables.Rd @@ -138,7 +138,9 @@ to print out information about factor casting.} \item{compare}{(\code{logical})\cr Whether comparison statistics should be analyzed instead of summary statistics (\code{compare = TRUE} adds \code{pval} statistic comparing against reference group).} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("analyze_vars_numeric")} to see +statistics available for numeric variables, and \code{get_stats("analyze_vars_counts")} for statistics available +for non-numeric variables.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/compare_variables.Rd b/man/compare_variables.Rd index c937b6ceb8..750a8e1d27 100644 --- a/man/compare_variables.Rd +++ b/man/compare_variables.Rd @@ -109,7 +109,9 @@ to avoid warnings from \code{rtables}.} \item{section_div}{(\code{string})\cr string which should be repeated as a section divider after each group defined by this split instruction, or \code{NA_character_} (the default) for no section divider.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("analyze_vars_numeric")} to see +statistics available for numeric variables, and \code{get_stats("analyze_vars_counts")} for statistics available +for non-numeric variables.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_cumulative.Rd b/man/count_cumulative.Rd index f4a986a167..32b20fef79 100644 --- a/man/count_cumulative.Rd +++ b/man/count_cumulative.Rd @@ -70,7 +70,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_cumulative")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_missed_doses.Rd b/man/count_missed_doses.Rd index a4e02a3963..5757ac8fc5 100644 --- a/man/count_missed_doses.Rd +++ b/man/count_missed_doses.Rd @@ -55,7 +55,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_missed_doses")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_occurrences.Rd b/man/count_occurrences.Rd index f7c5f5d156..91328fc06b 100644 --- a/man/count_occurrences.Rd +++ b/man/count_occurrences.Rd @@ -87,7 +87,8 @@ by a statistics function.} (must be present as second argument in Content Row Functions). See \code{\link[rtables:summarize_row_groups]{rtables::summarize_row_groups()}} for more information.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_occurrences")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_occurrences_by_grade.Rd b/man/count_occurrences_by_grade.Rd index 3222c09ead..3ab336c87c 100644 --- a/man/count_occurrences_by_grade.Rd +++ b/man/count_occurrences_by_grade.Rd @@ -95,7 +95,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_occurrences_by_grade")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_patients_events_in_cols.Rd b/man/count_patients_events_in_cols.Rd index 84011b90ce..78e1abcea5 100644 --- a/man/count_patients_events_in_cols.Rd +++ b/man/count_patients_events_in_cols.Rd @@ -52,7 +52,9 @@ be used as label.} \item{...}{additional arguments for the lower level functions.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run +\code{get_stats("summarize_patients_events_in_cols")} to see available statistics for this function, in addition to any +added using \code{filters_list}.} \item{.labels}{(named \code{character})\cr labels for the statistics (without indent).} diff --git a/man/count_patients_with_event.Rd b/man/count_patients_with_event.Rd index 173780583e..882abfe795 100644 --- a/man/count_patients_with_event.Rd +++ b/man/count_patients_with_event.Rd @@ -81,7 +81,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_patients_with_event")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_patients_with_flags.Rd b/man/count_patients_with_flags.Rd index 0464e49820..19981fcc13 100644 --- a/man/count_patients_with_flags.Rd +++ b/man/count_patients_with_flags.Rd @@ -88,7 +88,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_patients_with_flags")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/count_values_funs.Rd b/man/count_values_funs.Rd index 33d0d3b0e8..4a500b1723 100644 --- a/man/count_values_funs.Rd +++ b/man/count_values_funs.Rd @@ -83,7 +83,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("count_values")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/default_stats_formats_labels.Rd b/man/default_stats_formats_labels.Rd index ff494cd85a..1c84fbea96 100644 --- a/man/default_stats_formats_labels.Rd +++ b/man/default_stats_formats_labels.Rd @@ -7,13 +7,19 @@ \alias{get_formats_from_stats} \alias{get_labels_from_stats} \alias{get_indents_from_stats} +\alias{tern_default_stats} \alias{tern_default_formats} \alias{tern_default_labels} \alias{summary_formats} \alias{summary_labels} \alias{summary_custom} -\title{Defaults for statistical method names and their associated formats & labels} +\title{Get default statistical methods and their associated formats, labels, and indent modifiers} \format{ +\itemize{ +\item \code{tern_default_stats} is a named list of available statistics, with each element +named for their corresponding statistical method group. +} + \itemize{ \item \code{tern_default_formats} is a named vector of available default formats, with each element named for their corresponding statistic. @@ -37,6 +43,8 @@ get_labels_from_stats(stats, labels_in = NULL, row_nms = NULL) get_indents_from_stats(stats, indents_in = NULL, row_nms = NULL) +tern_default_stats + tern_default_formats tern_default_labels @@ -55,21 +63,21 @@ summary_custom( ) } \arguments{ -\item{method_groups}{(\code{character})\cr indicates the group of statistical methods that -we need the defaults from. A character vector can be used to collect more than one group of statistical -methods.} +\item{method_groups}{(\code{character})\cr indicates the statistical method group (\code{tern} analyze function) +to retrieve default statistics for. A character vector can be used to specify more than one statistical +method group.} -\item{stats_in}{(\code{character})\cr desired stats to be picked out from the selected method group.} +\item{stats_in}{(\code{character})\cr statistics to retrieve for the selected method group.} -\item{add_pval}{(\code{flag})\cr should \code{"pval"} or \code{"pval_counts"} (if \code{method_groups} contains +\item{add_pval}{(\code{flag})\cr should \code{"pval"} (or \code{"pval_counts"} if \code{method_groups} contains \code{"analyze_vars_counts"}) be added to the statistical methods?} -\item{stats}{(\code{character})\cr statistical methods to get defaults formats or labels for.} +\item{stats}{(\code{character})\cr statistical methods to get defaults for.} \item{formats_in}{(named \code{vector}) \cr inserted formats to replace defaults. It can be a character vector from \code{\link[formatters:list_formats]{formatters::list_valid_format_labels()}} or a custom format function.} -\item{labels_in}{(named \code{vector})\cr inserted labels to replace defaults.} +\item{labels_in}{(named \code{vector} of \code{character})\cr inserted labels to replace defaults.} \item{row_nms}{(\code{character})\cr row names. Levels of a \code{factor} or \code{character} variable, each of which the statistics in \code{.stats} will be calculated for. If this parameter is set, these @@ -103,17 +111,18 @@ statistics by setting \code{indent_mods_custom} to a single integer value.} } \value{ \itemize{ -\item \code{get_stats()} returns a character vector with all default statistical methods. +\item \code{get_stats()} returns a \code{character} vector of statistical methods. } \itemize{ -\item \code{get_formats_from_stats()} returns a named list of formats, they being a value from +\item \code{get_formats_from_stats()} returns a named vector of formats (if present in either +\code{tern_default_formats} or \code{formats_in}, otherwise \code{NULL}). Values can be taken from \code{\link[formatters:list_formats]{formatters::list_valid_format_labels()}} or a custom function (e.g. \link{formatting_functions}). } \itemize{ -\item \code{get_labels_from_stats()} returns a named character vector of default labels (if present -otherwise \code{NULL}). +\item \code{get_labels_from_stats()} returns a named \code{character} vector of labels (if present in either +\code{tern_default_labels} or \code{labels_in}, otherwise \code{NULL}). } \itemize{ @@ -138,25 +147,26 @@ and \code{indent_mods}. \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} Utility functions to get valid statistic methods for different method groups -(\code{.stats}) and their associated formats (\code{.formats}) and labels (\code{.labels}). This utility -is used across \code{tern}, but some of its working principles can be seen in \code{\link[=analyze_vars]{analyze_vars()}}. -See notes to understand why this is experimental. +(\code{.stats}) and their associated formats (\code{.formats}), labels (\code{.labels}), and indent modifiers +(\code{.indent_mods}). This utility is used across \code{tern}, but some of its working principles can be +seen in \code{\link[=analyze_vars]{analyze_vars()}}. See notes to understand why this is experimental. } \details{ Current choices for \code{type} are \code{counts} and \code{numeric} for \code{\link[=analyze_vars]{analyze_vars()}} and affect \code{get_stats()}. } \section{Functions}{ \itemize{ -\item \code{get_stats()}: Get defaults statistical methods for different -groups of methods. +\item \code{get_stats()}: Get statistics available for a given method +group (analyze function). -\item \code{get_formats_from_stats()}: Get formats from vector of statistical methods. If not -present \code{NULL} is returned. +\item \code{get_formats_from_stats()}: Get formats corresponding to a list of statistics. -\item \code{get_labels_from_stats()}: Get labels from vector of statistical methods. +\item \code{get_labels_from_stats()}: Get labels corresponding to a list of statistics. \item \code{get_indents_from_stats()}: Format indent modifiers for a given vector/list of statistics. +\item \code{tern_default_stats}: Named list of available statistics by method group for \code{tern}. + \item \code{tern_default_formats}: Named vector of default formats for \code{tern}. \item \code{tern_default_labels}: Named \code{character} vector of default labels for \code{tern}. diff --git a/man/estimate_multinomial_rsp.Rd b/man/estimate_multinomial_rsp.Rd index b3cff3fb4d..9767dcba74 100644 --- a/man/estimate_multinomial_rsp.Rd +++ b/man/estimate_multinomial_rsp.Rd @@ -49,7 +49,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("estimate_multinomial_response")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/estimate_proportions.Rd b/man/estimate_proportions.Rd index 7fce15b0ec..e785b535f9 100644 --- a/man/estimate_proportions.Rd +++ b/man/estimate_proportions.Rd @@ -90,7 +90,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("estimate_proportion")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/incidence_rate.Rd b/man/incidence_rate.Rd index 16db00037a..961e83c6db 100644 --- a/man/incidence_rate.Rd +++ b/man/incidence_rate.Rd @@ -75,7 +75,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("estimate_incidence_rate")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/odds_ratio.Rd b/man/odds_ratio.Rd index 6ab700ead7..d01e6082c7 100644 --- a/man/odds_ratio.Rd +++ b/man/odds_ratio.Rd @@ -79,7 +79,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("estimate_odds_ratio")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/prop_diff.Rd b/man/prop_diff.Rd index f6a60c42b4..880dffd42b 100644 --- a/man/prop_diff.Rd +++ b/man/prop_diff.Rd @@ -84,7 +84,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("estimate_proportion_diff")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/prop_diff_test.Rd b/man/prop_diff_test.Rd index 2babe8f7c4..af4a86a21b 100644 --- a/man/prop_diff_test.Rd +++ b/man/prop_diff_test.Rd @@ -74,7 +74,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("test_proportion_diff")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/summarize_ancova.Rd b/man/summarize_ancova.Rd index 4405cdac5d..8e40ef601a 100644 --- a/man/summarize_ancova.Rd +++ b/man/summarize_ancova.Rd @@ -88,7 +88,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("summarize_ancova")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/summarize_change.Rd b/man/summarize_change.Rd index fa056f3665..9bd064f942 100644 --- a/man/summarize_change.Rd +++ b/man/summarize_change.Rd @@ -48,7 +48,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \verb{get_stats("analyze_vars_numeric)} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/summarize_glm_count.Rd b/man/summarize_glm_count.Rd index 33c5f841dd..8704187af3 100644 --- a/man/summarize_glm_count.Rd +++ b/man/summarize_glm_count.Rd @@ -91,7 +91,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("summarize_glm_count")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/summarize_num_patients.Rd b/man/summarize_num_patients.Rd index 22ae0c0c0b..d6d0cdf86c 100644 --- a/man/summarize_num_patients.Rd +++ b/man/summarize_num_patients.Rd @@ -82,7 +82,8 @@ by a statistics function.} \item{na_str}{(\code{string})\cr string used to replace all \code{NA} or empty values in the output.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("summarize_num_patients")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/summarize_patients_exposure_in_cols.Rd b/man/summarize_patients_exposure_in_cols.Rd index 0d15ebfed3..5559c08f71 100644 --- a/man/summarize_patients_exposure_in_cols.Rd +++ b/man/summarize_patients_exposure_in_cols.Rd @@ -64,7 +64,8 @@ analyze_patients_exposure_in_cols( (must be present as second argument in Content Row Functions). See \code{\link[rtables:summarize_row_groups]{rtables::summarize_row_groups()}} for more information.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run +\code{get_stats("analyze_patients_exposure_in_cols")} to see available statistics for this function.} \item{.N_col}{(\code{integer})\cr column-wise N (column count) for the full column being analyzed that is typically passed by \code{rtables}.} diff --git a/man/survival_coxph_pairwise.Rd b/man/survival_coxph_pairwise.Rd index 272d6e0f95..b3acb2b678 100644 --- a/man/survival_coxph_pairwise.Rd +++ b/man/survival_coxph_pairwise.Rd @@ -85,7 +85,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("coxph_pairwise")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/survival_time.Rd b/man/survival_time.Rd index 8a72bca3b2..175af2dd53 100644 --- a/man/survival_time.Rd +++ b/man/survival_time.Rd @@ -60,7 +60,8 @@ underneath analyses, which is not allowed.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("surv_time")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.} diff --git a/man/survival_timepoint.Rd b/man/survival_timepoint.Rd index 5160962dee..743fb427cc 100644 --- a/man/survival_timepoint.Rd +++ b/man/survival_timepoint.Rd @@ -112,7 +112,8 @@ avoid warnings from duplicate table names.} \item{method}{(\code{string})\cr either \code{surv} (survival estimations), \code{surv_diff} (difference in survival with the control) or \code{both}.} -\item{.stats}{(\code{character})\cr statistics to select for the table.} +\item{.stats}{(\code{character})\cr statistics to select for the table. Run \code{get_stats("surv_timepoint")} +to see available statistics for this function.} \item{.formats}{(named \code{character} or \code{list})\cr formats for the statistics. See Details in \code{analyze_vars} for more information on the \code{"auto"} setting.}