Skip to content

Releases: insightsengineering/tern

v0.9.10

18 Dec 09:45
9f4d42b

Choose a tag to compare

Enhancements

  • Added alternative argument to test_proportion_diff() to allow one-sided hypothesis testing.
  • Added cmh_sato method to estimate_proportion_diff() for Cochran-Mantel-Haenszel proportion difference confidence interval using the Sato variance estimator.
  • Added cmh_mn method to estimate_proportion_diff() for Cochran-Mantel-Haenszel proportion difference confidence interval using the Miettinen and Nurminen method.
  • Added cmh_wh (CMH with Wilson-Hilferty transformation) method to test_proportion_diff() for stratified proportion difference testing.
  • analyze_vars now accepts format, formats_var and na_strs_var and passes them directly down to analyze
  • When .formats is "default" (the string), all stats will be assigned the "default" format label rather than the default formats baked into tern. This is intended for use in conjunction with the format or formats_var arguments to analyze (and now analyze_vars).

Bug Fixes

  • Fixed bug in tabulate_rsp_subgroups() and tabulate_survival_subgroups() preventing risk difference column format specified via control_riskdiff() from being applied.
  • Fixed bug in a_summary() causing an error when all values of a factor input variable were NA.
  • Fixed NA behavior in s_summary.factor and s_summary.character when na.rm = FALSE to ensure that NA values are always represented in output tables.
  • Unified explicit NA behavior for missing values in explicit_na().

What's Changed

Full Changelog: v0.9.9...v0.9.10

v0.9.9

23 Jun 15:42
2c53de1

Choose a tag to compare

Enhancements

  • Updated tabulate_rsp_subgroups() and tabulate_survival_subgroups() to specify parameter parent_name when using split_rows_by() and analyze() internally to enhance table paths.

Bug Fixes

  • Fixed bug in g_lineplot() where table_format and table_labels arguments were ignored.
  • Fixed bug in g_lineplot() to allow use of a function as a format for table stats.

Miscellaneous

  • Converted assert_df_with_factors(), assert_df_with_variables(), assert_proportion_value(), check_diff_prop_ci(), clogit_with_tryCatch(), get_covariates(), labels_or_names(), range_noinf() , s_surv_timepoint(), and s_test_proportion_diff() to exported functions.

What's Changed

  • Fix warning from get_formats_from_stats() by @edelarua in #1420
  • 1418 [Bug]: g_lineplot doesn't work with a format as a function by @yurovska in #1421
  • alter var_labels by @shajoezhu in #1423
  • 1425 feature request export various internal functions for usage in jj based sister package to nest tern by @iaugusty in #1426
  • v0.9.9 Release [skip vbump] by @edelarua in #1427

Full Changelog: v0.9.8...v0.9.9

v0.9.8.433

17 Apr 14:47

Choose a tag to compare

Enhancements

  • Refactored count_abnormal(), count_abnormal_by_baseline(), count_abnormal_by_marked(), count_abnormal_by_worst_grade(), count_abnormal_lab_worsen_by_baseline(), count_cumulative(), count_missed_doses(), coxph_pairwise(), estimate_multinomial_rsp(), estimate_proportion(), estimate_proportion_diff(), estimate_odds_ratio(), summarize_ancova(), summarize_glm_count(), summarize_num_patients(), surv_timepoint(), and test_proportion_diff() to work without make_afun().
  • Refactored afun_riskdiff(), count_occurrences(), count_occurrences_by_grade(), count_patients_with_event(), count_patients_with_flags(), count_values(), estimate_incidence_rate(), h_tab_one_biomarker(), summarize_change(), summarize_colvars(), summarize_patients_exposure_in_cols(), survival_time(), tabulate_rsp_subgroups(), tabulate_survival_subgroups(), tabulate_rsp_biomarkers(), and tabulate_survival_biomarkers() to align with new analysis function style.
  • Added geom_sd and geom_mean_sd to s_summary() as default available statistics.
  • Added denom parameter to estimate_proportion().
  • Added weights_emmeans argument to summarize_ancova().

Bug Fixes

  • Fixed bug in a_count_patients_with_flags() preventing select custom label/indentation formats from being applied.
  • Fixed bug in tabulate_rsp_subgroups() and tabulate_survival_subgroups() preventing the pct option from having an effect when adding a risk difference column.
  • Fixed bug with the order of .stats when adding custom statistical functions.
  • Fixed bug with multiple custom functions not being represented correctly as a list of output stats.

Miscellaneous

  • Began deprecation of the unused table_names argument to count_abnormal_lab_worsen_by_baseline().
  • Began deprecation of the unused h_split_param() function.
  • Began deprecation of the unused label_all parameter to tabulate_rsp_subgroups(), with redirection to the same parameter in extract_rsp_subgroups().
  • Began deprecation of the no longer used helper functions h_tab_one_biomarker(), h_tab_rsp_one_biomarker(), and h_tab_surv_one_biomarker().
  • Updated documentation to remove suggestions to use make_afun().
  • Added warnings for geom_mean statistical output.
  • Moved helper functions h_tab_rsp_one_biomarker() and h_tab_surv_one_biomarker() into h_biomarkers_subgroups.R.
  • Reorganized the utility documentation related to factors (utils_factor.R) into a single file.
  • Converted as_factor_keep_attributes() to an exported function.
  • Removed internal function ungroup_stats() and replaced its usage with the get_*_from_stats() functions.
  • Removed s_count_nonmissing() as it is a non-repeated small and internal function.

Full Changelog: v0.9.8...v0.9.8.433

v0.9.8

14 Apr 21:35
960e2ee

Choose a tag to compare

Enhancements

  • Refactored count_abnormal(), count_abnormal_by_baseline(), count_abnormal_by_marked(), count_abnormal_by_worst_grade(), count_abnormal_lab_worsen_by_baseline(), count_cumulative(), count_missed_doses(), coxph_pairwise(), estimate_multinomial_rsp(), estimate_proportion(), estimate_proportion_diff(), estimate_odds_ratio(), summarize_ancova(), summarize_glm_count(), summarize_num_patients(), surv_timepoint(), and test_proportion_diff() to work without make_afun().
  • Refactored afun_riskdiff(), count_occurrences(), count_occurrences_by_grade(), count_patients_with_event(), count_patients_with_flags(), count_values(), estimate_incidence_rate(), h_tab_one_biomarker(), summarize_change(), summarize_colvars(), summarize_patients_exposure_in_cols(), survival_time(), tabulate_rsp_subgroups(), tabulate_survival_subgroups(), tabulate_rsp_biomarkers(), and tabulate_survival_biomarkers() to align with new analysis function style.
  • Added geom_sd and geom_mean_sd to s_summary() as default available statistics.
  • Added denom parameter to estimate_proportion().
  • Added weights_emmeans argument to summarize_ancova().

Bug Fixes

  • Fixed bug in a_count_patients_with_flags() preventing select custom label/indentation formats from being applied.
  • Fixed bug in tabulate_rsp_subgroups() and tabulate_survival_subgroups() preventing the pct option from having an effect when adding a risk difference column.
  • Fixed bug with the order of .stats when adding custom statistical functions.
  • Fixed bug with multiple custom functions not being represented correctly as a list of output stats.

Miscellaneous

  • Began deprecation of the unused table_names argument to count_abnormal_lab_worsen_by_baseline().
  • Began deprecation of the unused h_split_param() function.
  • Began deprecation of the unused label_all parameter to tabulate_rsp_subgroups(), with redirection to the same parameter in extract_rsp_subgroups().
  • Began deprecation of the no longer used helper functions h_tab_one_biomarker(), h_tab_rsp_one_biomarker(), and h_tab_surv_one_biomarker().
  • Updated documentation to remove suggestions to use make_afun().
  • Added warnings for geom_mean statistical output.
  • Moved helper functions h_tab_rsp_one_biomarker() and h_tab_surv_one_biomarker() into h_biomarkers_subgroups.R.
  • Reorganized the utility documentation related to factors (utils_factor.R) into a single file.
  • Converted as_factor_keep_attributes() to an exported function.
  • Removed internal function ungroup_stats() and replaced its usage with the get_*_from_stats() functions.
  • Removed s_count_nonmissing() as it is a non-repeated small and internal function.

What's Changed

New Contributors

Full Changelog: v0.9.7...v0.9.8

v0.9.7 cran

17 Jan 08:40
51c87f1

Choose a tag to compare

Enhancements

  • Added the denom parameter to s_count_cumulative(), s_count_missed_doses(), and s_count_occurrences_by_grade().
  • Added "N_row" as an optional input to denom in s_count_occurrences().
  • Added rel_height_plot parameter to g_lineplot() to control the line plot height relative to annotation table height.
  • Added as_list parameter to g_lineplot() to allow users to return the line plot and annotation table elements as a list instead of stacked for more complex customization.
  • Added vignette "Understanding tern functions" for future reference.
  • Added to analyze_vars() statistical names that are used by rtables::as_result_df().
  • Added the possibility to integrate custom statistical functions to default ones in analyze_vars().
  • Refactored analyze_vars() and a_summary() to take all options from ?rtables::additional_fun_params.
  • Refactored summarize_change() and count_values() to work without make_afun().
  • Refactored a_count_occurrences_by_grade(), a_count_patients_with_event(), and a_count_patients_with_flags() to no longer use make_afun().
  • Refactored get_labels_from_stats() to use a named list of levels for each statistic instead of row names.
  • Updated the table_font_size parameter of g_lineplot() to control the size of all text in the annotation table, including labels.
  • Merged compare_vars() into analyze_vars() as overlap was significant.

Bug Fixes

  • Fixed bug in a_summary() causing non-unique row_name values to occur when multiple statistics are selected for count variables.

Miscellaneous

  • Reverted deprecation of quick get functions summary_formats() and summary_labels(). Added disclaimer about underlying use of get_stats.
  • Corrected handling of extra arguments and NA for summarize_change().
  • Removed count_fraction_fixed_dp exception by assigning it to the result of count_fraction with a different format output.

What's Changed

New Contributors

Full Changelog: v0.9.6...v0.9.7

v0.9.6 cran

24 Sep 05:36
ceb70fc

Choose a tag to compare

Enhancements

  • Added errorbar_width and linetype parameters to g_lineplot.
  • Added the .formats argument to tabulate_rsp_subgroups and tabulate_survival_subgroups to allow users to specify formats.
  • Added the riskdiff argument to tabulate_rsp_subgroups and tabulate_survival_subgroups to allow users to add a risk difference table column, and function control_riskdiff to specify settings for the risk difference column.
  • Added warning to tabulate_rsp_subgroups when pval statistic is selected but df has not been correctly generated to add p-values to the output table.
  • Added n_rate statistic as a non-default option to estimate_incidence_rate which returns both number of events observed and estimated incidence rate.
  • Added n_unique statistic as a non-default option to estimate_incidence_rate which returns total number of patients with at least one event observed.
  • Refactored estimate_incidence_rate to work as both an analyze function and a summarize function, controlled by the added summarize parameter. When summarize = TRUE, labels can be fine-tuned via the new label_fmt argument to the same function.
  • Added fraction statistic to the analyze_var_count method group.
  • Improved summarize_glm_count() documentation and all its associated functions to better describe the results and the functions' purpose.

Bug Fixes

  • Added defaults for d_count_cumulative parameters as described in the documentation.
  • Fixed a bug of empty levels on g_lineplot x-axis were not shown in either plots.
  • Fixed a bug in a_surv_time that threw an error when split only has "is_event".
  • Fixed disappearing line in g_lineplot when using only one group or strata level.
  • Fixed defaults for formats and labels in get_formats_from_stats and get_labels_from_stats.
  • Fixed bug for linear scaling factor (scale parameter) being applied to response but not to rate in h_glm_count while all distributions have logarithmic link function.
  • Fixed bug in decorate_grob that did not handle well empty strings or NULL values for title and footers.
  • Fixed bug in g_km that caused an error when multiple records in the data had estimates at max time.
  • Fixed issue with wrong wrapping due to different \n and vector behavior that did not cope well with split_string().

Miscellaneous

  • Began deprecation of the confusing functions summary_formats and summary_labels.
  • Enhanced general descriptions of analyze and summarize functions throughout package documentation.
  • Finalized deprecation of the strata and cohort_id arguments to g_lineplot.
  • Moved incidence rate helper functions into a separate h_incidence_rate.R file.

What's Changed

Full Changelog: v0.9.5...v0.9.6

v0.9.5 cran

21 Jun 05:49
6d6da70

Choose a tag to compare

Enhancements

  • Added facet_var to g_lineplot to allow plot faceting by a factor variable.
  • Added examples and tests for label_all parameter to extract_survival_biomarkers and extract_survival_subgroups.
  • Added the xticks, xlim, and ylim arguments to g_lineplot to allow for customization of the x and y axes.
  • Updated g_lineplot legend to follow factor levels set by users.

Bug Fixes

  • Fixed a bug in s_ancova that prevented statistics from being printed when arm levels include special characters.
  • Fixed a bug in decorate_grob that prevented the right margins to be respected when adding title and footers decorations.

Miscellaneous

  • Began deprecation of the unused label_all parameter to tabulate_survival_biomarkers and tabulate_survival_subgroups, with redirection to the same parameter in their associated extract_* functions.

What's Changed

  • Fix documentation for the label_all argument of extract_* functions by @edelarua in #1232
  • Manually specify shapes within g_lineplot when >6 group levels exist by @edelarua in #1234
  • update g_lineplot code to handle special characters by @ayogasekaram in #1230
  • Add revdepcheck configuration by @walkowif in #1228
  • Fix bug in s_ancova when arm levels include special characters by @edelarua in #1242
  • Fix indentation in functions that use matrix_form by @edelarua in #1239
  • Add xticks, xlim, and ylim arguments to g_lineplot by @edelarua in #1244
  • fix decorate grob vp widths for titles and footers when right margin is present by @Melkiades in #1245
  • Truetype pagination PR check by @gmbecker in #1250
  • testing for rtables higher level ns PR by @gmbecker in #1251
  • prep for 0.9.5 [skip vbump] by @shajoezhu in #1253

New Contributors

Full Changelog: v0.9.4...v0.9.5

v0.9.4

17 Apr 07:29
2d9280e

Choose a tag to compare

New Features

  • Added h_glm_negbin to h_glm_count to enable count data analysis using a negative binomial model.
  • Added argument grade_groups_only to count_occurrences_by_grade to allow users to only display rows for specified grade groups.
  • Added internal function df2gg that converts data.frame objects to ggplot objects.
  • Added functions control_surv_med_annot and control_coxph_annot to configure g_km annotation table sizes/positions.
  • Refactored g_km to output a ggplot object instead of a grob object.
  • Refactored g_forest to output a ggplot object instead of a grob object.

Enhancements

  • Default format for mean p-values (mean_pval) updated from "xx.xx" to "x.xxxx | (<0.0001)".

Bug Fixes

  • Fixed nested column split label overlay issue in rtable2gg to clean up appearance of text labels.
  • Fixed bug in s_ancova causing incorrect difference calculations for arm variables with irregular levels.
  • Fixed bug in format_count_fraction_fixed_dp that did not have the same print when the fraction was 1 (100%).
  • Fixed bug in g_lineplot causing default labels not to update according to specified control settings.
  • Fixed bug causing an error when automatic value formatting was applied to NA values.

Miscellaneous

  • Added function expect_snapshot_ggplot to test setup file to process plot snapshot tests and allow plot dimensions to be set.
  • Adapted to argument renames introduced in ggplot2 3.5.0.
  • Renamed individual_patient_plot.R to g_ipp.R.
  • Removed all instances of deprecated parameters time_unit_input, time_unit_output, na_level and indent_mod.
  • Removed deprecated functions summarize_vars, control_summarize_vars, a_compare, create_afun_summary, create_afun_compare, and summary_custom.
  • Removed vdiffr package from Suggests in DESCRIPTION file.
  • Began deprecation of the named element strat, to be renamed to strata, within the variables argument to h_rsp_to_logistic_variables, h_logistic_mult_cont_df, h_odds_ratio_subgroups_df, h_coxreg_mult_cont_df, h_coxph_subgroups_df, h_tbl_coxph_pairwise, extract_rsp_biomarkers, extract_rsp_subgroups, extract_survival_biomarkers, and extract_survival_subgroups.
  • Began deprecation of the strat argument to s_coxph_pairwise and replaced it with the strata argument.
  • Began deprecation of the forest_grob, forest_dot_line, forest_viewport, vp_forest_table_part, and grid.forest functions.
  • Began deprecation of no longer used Kaplan-Meier helper functions h_ggkm, h_decompose_gg, h_km_layout, h_grob_tbl_at_risk, h_grob_median_surv, h_grob_y_annot, and h_grob_coxph.
  • Began deprecation of grob/grid related functions stack_grobs, arrange_grobs, and draw_grob which are no longer used in tern.

What's Changed

New Contributors

Full Changelog: v0.9.3...v0.9.4

v0.9.3

08 Dec 17:05
dd9f020

Choose a tag to compare

New Features

  • Added ref_group_position function to place the reference group facet last, first or at a certain position.
  • Added keep_level_order split function to retain original order of levels in a split.
  • Added level_order split function to reorder manually the levels.
  • Added function get_indents_from_stats to format and return indent modifiers for a given set of statistics.
  • 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.
  • Added summarize function version of count_occurrences analyze function, summarize_occurrences.
  • Added referential footnotes to surv_time for censored range observations, controlled via the ref_fn_censor parameter.
  • Added helper function h_adlb_abnormal_by_worst_grade to prepare ADLB data to use as input in count_abnormal_by_worst_grade.
  • Added function rtable2gg that converts rtable objects to ggplot objects.
  • Added helper function to set default na_str globally with set_default_na_str() and added default_na_str() for all interested functions.

Enhancements

  • Added ref_group_coxph parameter to g_km to specify the reference group used for pairwise Cox-PH calculations when annot_coxph = TRUE.
  • Added annot_coxph_ref_lbls parameter to g_km to enable printing the reference group in table labels when annot_coxph = TRUE.
  • Added x_lab parameter to g_lineplot to customize x-axis label.
  • Remove 25% padding of y-axis in g_lineplot.
  • Added support for creating multiple risk difference columns, each comparing to a single comparison group. Multiple comparison groups can be specified as a vector via the arm_y argument.
  • Allowed numeric vector as count_by input in analyze_num_patients and summarize_num_patients.
  • Aligned plot and table vertically in g_lineplot.

Bug Fixes

  • Fixed bug in decorate_grob preventing text wrapping from accounting for font size.
  • Fixed implementation of na_str argument in all column-wise analysis and tabulation functions.

Miscellaneous

  • Specified minimal version of package dependencies.
  • Upgraded to_string_matrix to take into account widths and other printing parameters.

What's Changed

New Contributors

Full Changelog: v0.9.2...v0.9.3

v0.9.2

20 Oct 10:44
605f6cd

Choose a tag to compare

New Features

  • Added the na_str argument to analyze & summarize_row_groups wrapper functions count_abnormal, count_abnormal_by_baseline, count_abnormal_by_marked, count_abnormal_by_worst_grade, count_abnormal_lab_worsen_by_baseline, count_cumulative, count_missed_doses, count_occurrences, count_occurrences_by_grade, summarize_occurrences_by_grade, summarize_patients_events_in_cols, count_patients_with_event, count_patients_with_flags, count_values, estimate_multinomial_response, estimate_proportion, h_tab_one_biomarker, estimate_incidence_rate, logistic_summary_by_flag, estimate_odds_ratio, estimate_proportion_diff, test_proportion_diff, summarize_ancova, summarize_change, summarize_glm_count, summarize_num_patients, analyze_num_patients, summarize_patients_exposure_in_cols, coxph_pairwise, tabulate_survival_subgroups, surv_time, and surv_timepoint.

Enhancements

  • Added formatting function format_count_fraction_lt10 for formatting count_fraction with special consideration when count is less than 10.
  • Updated s_summary.logical output for count_fraction when denominator is zero to display as NA instead of 0 in tables.
  • Updated analyze_vars_in_cols to allow character input to indicate whether nominal time point is post-dose or pre-dose when applying the 1/3 imputation rule.

Bug Fixes

  • Fixed bug in g_km causing an error when converting certain annotation width units.

Miscellaneous

  • Began deprecation of na_level argument in s_count_abnormal_by_baseline, a_summary, analyze_vars, analyze_vars_in_cols, compare_vars, h_map_for_count_abnormal, h_stack_by_baskets, summarize_colvars, a_coxreg, and summarize_coxreg and replaced it with the na_str argument.

What's Changed

Full Changelog: v0.9.1...v0.9.2