Releases: insightsengineering/tern
Releases · insightsengineering/tern
v0.7.3
- Added Subgroup Treatment Effect Pattern (STEP) model fitting functions
fit_rsp_step
andfit_survival_step
, the corresponding tidy methodtidy.step
as well as the graph functiong_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 thesummarize_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 ofbase::range
. It returnsc(NA, NA)
instead ofc(-Inf, Inf)
for zero-length data.
- Cox regression via
fit_coxreg_univar
andfit_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 bys_count_occurrences
. It contains a list of numerators and denominators with one element per occurrence. - Updated
sum_num_patients
andcount_occurrences
for the resultunique
andcount_fraction
to return (0, 0) when input is empty. - Added a new argument
groups_lists
toextract_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 bytabulate_rsp_subgroups
andtabulate_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 functionrange_noinf
instead ofbase::range
. - New argument
no_fillin_visits
added toh_adsl_adlb_merge_using_worst_flag
to specify the visits that are excluded from post-baseline worst toxicity grade output. Improvedh_adsl_adlb_merge_using_worst_flag
to include variables shared betweenadsl
andadlb
, along withPARAM
,PARAMCD
,ATOXGR
,BTOXGR
and optionallyAVISIT
,AVISITN
whenby_visit = TRUE
. Previously, output only containsUSUBJID
,ARMCD
,PARAMCD
,ATOXGR
, andBTOXGR
. - 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, norow names contain missing values
error would show. - Deprecated
s_cox_univariate
function, usefit_coxreg_univar
function instead. - Updated default formats of hr and hr_ci in
a_coxph_pairwise
and median ins_surv_time
to align with STREAM. - Updated the pre-processing code in the files
test-table_ttet01.R
andtest-table_dort01.R
to make sure the analysis variableEVNT1
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
- Fixed internal test errors regarding column labels.
v0.7.1
- New argument
position_surv_med
added tog_km
to move position of the annotation table with median survival times. - Fixed bug in
g_km
related to the argumentspch
andsize
. Previously, these arguments were not passed on to helper functionh_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 inh_xticks
to allow this. - Fixed bug in
prop_diff_cmh
that led toNaN
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 toestimate_incidence_rate
. - New argument
denom
added tocount_occurrences
. - New arguments
yval
andci_ribbon
added tog_km
. - Add new individual patient plot function
g_ipp
along with helpersh_g_ipp
andh_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
andstat_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 ofNA
or+/-Inf
for confidence interval (CI) estimates. - Rename
n_lim
argument ofstat_mean_ci
ton_min
to better reflect its desired meaning.
v0.7.0
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
andcount_missed_doses
. - Counting patients with event flags with
count_patients_with_event
andcount_patients_with_flags
. - Summarizing variables with
summarize_vars
(supports numeric, factor, character and logical variables). Note that factors need to haveNA
s converted tona_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
andsummarize_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
andas.rtable
andsummarize_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
andcount_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
andtabulate_rsp_subgroups
. - Tabulating the survival duration by subgroup with
extract_survival_subgroups
andtabulate_survival_subgroups
.
v0.6.9
- Removing not used imports.