Skip to content

Releases: insightsengineering/tern

v0.7.3

19 Aug 22:15
Compare
Choose a tag to compare
  • Added Subgroup Treatment Effect Pattern (STEP) model fitting functions fit_rsp_step and fit_survival_step, the corresponding tidy method tidy.step as well as the graph function g_step.
  • Added new layout function compare_vars which compares variables of different types between columns and produces a p-value for the comparison to the reference column. It is built on top of the summarize_vars functionality.
  • Added utility functions:
    • cut_quantile_bins cuts a numeric vector into quantile bins.
    • fct_collapse_only collapses levels of a factor and only keeps those in the order provided.
    • fct_explicit_na_if inserts explicit missings in a factor based on a condition.
    • range_noinf is a kind of a wrapper function of base::range. It returns c(NA, NA) instead of c(-Inf, Inf) for zero-length data.
  • Cox regression via fit_coxreg_univar and fit_coxreg_multivar is now also possible without treatment arm. In the univariate case this means that separate univariate models for the provided covariates are fitted and the corresponding effect estimates can later be tabulated.
  • Added fraction in result returned by s_count_occurrences. It contains a list of numerators and denominators with one element per occurrence.
  • Updated sum_num_patients and count_occurrences for the result unique and count_fraction to return (0, 0) when input is empty.
  • Added a new argument groups_lists to extract_survival_subgroups, extract_rsp_subgroups and associated helper functions which allows to group factor levels of subgroup variables into manually defined groups, enhancing the flexibility of the resulting forest graphs.
  • Forest graph function g_forest now extracts default arguments from attributes of the input table produced by tabulate_rsp_subgroups and tabulate_survival_subgroups so that the user does not have to do this manually anymore.
  • In g_km:
    • Remove arm variable name from arm labels in plot legend and annotation tables.
    • Show symbol used to mark censored cases and match order of arm variable factor levels in the legend.
    • Display hazard ratio and its confidence interval to two decimal places.
    • Updated default position of hazard ratio table to stay on the left bottom corner but above x-axis.
    • Use arm value as strata name in when treatment arm variable only has one level.
  • Updated s_surv_time function to use a newly created function range_noinf instead of base::range.
  • New argument no_fillin_visits added to h_adsl_adlb_merge_using_worst_flag to specify the visits that are excluded from post-baseline worst toxicity grade output. Improved h_adsl_adlb_merge_using_worst_flag to include variables shared between adsl and adlb, along with PARAM, PARAMCD, ATOXGR, BTOXGR and optionally AVISIT, AVISITN when by_visit = TRUE. Previously, output only contains USUBJID, ARMCD, PARAMCD, ATOXGR, and BTOXGR.
  • Fix bug in s_surv_timepoint for cases when there are zero patients at risk.
  • Modified stat_median_ci function so that when empty var with empty name is passed, no row names contain missing values error would show.
  • Deprecated s_cox_univariate function, use fit_coxreg_univar function instead.
  • Updated default formats of hr and hr_ci in a_coxph_pairwise and median in s_surv_time to align with STREAM.
  • Updated the pre-processing code in the files test-table_ttet01.R and test-table_dort01.R to make sure the analysis variable EVNT1 has both levels of the factor defined.
  • Improved error message when number of levels in a factor variable in a data frame is not as expected.

v0.7.2

19 Aug 22:15
Compare
Choose a tag to compare
  • Fixed internal test errors regarding column labels.

v0.7.1

19 Aug 22:15
Compare
Choose a tag to compare
  • New argument position_surv_med added to g_km to move position of the annotation table with median survival times.
  • Fixed bug in g_km related to the arguments pch and size. Previously, these arguments were not passed on to helper function h_ggkm and so were effectively being ignored.
  • Updated xticks and max_time arguments in g_km for greater functionality. max_time added as an argument in h_xticks to allow this.
  • Fixed bug in prop_diff_cmh that led to NaN weighted proportion difference estimates and missing confidence intervals. Previously, when for at least one stratum no patients from one treatment arm were included, then the estimation did not lead to numeric results.
  • Fixed bug in prop_cmh which previously gave an error in case of at least one stratum containing less than two observations.
  • New argument n_events added to estimate_incidence_rate.
  • New argument denom added to count_occurrences.
  • New arguments yval and ci_ribbon added to g_km.
  • Add new individual patient plot function g_ipp along with helpers h_g_ipp and h_set_nest_theme.
  • Fixed bug in count_patients_with_events, now zero counts without percentage are shown.
  • Fixed bug in get_mmrm_lsmeans which previously did not allow MMRM analysis of more than 3000 observations.
  • Updated stat_mean_ci and stat_median_ci to correctly handle edge cases with number of elements in input series equal to 1. For such cases, NA_real_ is now returned, instead of NA or +/-Inf for confidence interval (CI) estimates.
  • Rename n_lim argument of stat_mean_ci to n_min to better reflect its desired meaning.

v0.7.0

19 Aug 22:15
Compare
Choose a tag to compare

This version of tern introduces a major rewriting of tern due to the change to layout based tabulation in rtables. tern now does not build tables directly anymore, instead it provides analysis functions to easily build tables, see the examples.

  • Counting patients with abnormal values post-baseline with count_abnormal.
  • Counting patients with graded abnormal values with count_abnormal_by_worst_grade.
  • Counting patients with abnormal values by baseline status with count_abnormal_by_baseline.
  • Counting patients with missed doses with s_count_missed_doses and count_missed_doses.
  • Counting patients with event flags with count_patients_with_event and count_patients_with_flags.
  • Summarizing variables with summarize_vars (supports numeric, factor, character and logical variables). Note that factors need to have NAs converted to na_level before use.
  • Summarizing change from baseline with summarize_change.
  • Summarizing variables in columns with summarize_colvars.
  • Estimating difference in terms of responder proportions with estimate_proportion_diff.
  • Estimating difference in terms of Odds Ratio with estimate_odds_ratio.
  • Testing the difference in responder proportions with test_proportion_diff.
  • Estimating the responder proportion regarding the level of a factor with estimate_multinomial_response.
  • Fitting and tabulating the results of Cox regressions with fit_coxreg_univar, fit_coxreg_multivar and summarize_coxreg, respectively.
  • Pruning occurrence tables (or tables with counts and fractions) with flexible rules, see ?prune_occurrences for details.
  • Sorting occurrence tables using different options, see ?score_occurrences for details.
  • Fitting and tabulating MMRMs with fit_mmrm and as.rtable and summarize_lsmeans, see ?tabulate_mmrm for details.
  • Counting the number of unique and non-unique patients with summarize_num_patients.
  • Counting occurrences with count_occurrences.
  • Counting occurrences by grade with summarize_occurrences_by_grade and count_occurrences_by_grade.
  • Counting patients and events in columns with summarize_patients_events_in_cols.
  • Tabulating the binary outcome response by subgroup with extract_rsp_subgroups and tabulate_rsp_subgroups.
  • Tabulating the survival duration by subgroup with extract_survival_subgroups and tabulate_survival_subgroups.

v0.6.9

19 Aug 22:15
Compare
Choose a tag to compare
  • Removing not used imports.