Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# tern 0.9.9.9001

### Bug Fixes
* Fixed bug in `tabulate_rsp_subgroups()` and `tabulate_survival_subgroups()` preventing risk difference column format specified via `control_riskdiff()` from being applied.

# tern 0.9.9

### Enhancements
Expand Down
1 change: 1 addition & 0 deletions R/response_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ tabulate_rsp_subgroups <- function(lyt,
colvars_or$vars <- c(colvars_or$vars, "riskdiff")
colvars_or$labels <- c(colvars_or$labels, riskdiff = riskdiff$col_label)
arm_cols <- paste(rep(c("n_rsp", "n_rsp", "n", "n")), c(riskdiff$arm_x, riskdiff$arm_y), sep = "_")
extra_args[[".formats"]] <- c(extra_args[[".formats"]], list(riskdiff = riskdiff$format))

df_prop_diff <- df$prop %>%
dplyr::select(-"prop") %>%
Expand Down
1 change: 1 addition & 0 deletions R/survival_duration_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ tabulate_survival_subgroups <- function(lyt,
colvars_hr$vars <- c(colvars_hr$vars, "riskdiff")
colvars_hr$labels <- c(colvars_hr$labels, riskdiff = riskdiff$col_label)
arm_cols <- paste(rep(c("n_events", "n_events", "n", "n")), c(riskdiff$arm_x, riskdiff$arm_y), sep = "_")
extra_args[[".formats"]] <- c(extra_args[[".formats"]], list(riskdiff = riskdiff$format))

df_prop_diff <- df$survtime %>%
dplyr::select(-"median") %>%
Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/_snaps/response_subgroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@
Code
res
Output
B: Placebo A: Drug X
Prop. Diff
Baseline Risk Factors Total n n Response (%) n Response (%) Odds Ratio 95% CI p-value (Chi-Squared Test) (95% CI)
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
All Patients 142 73 68.5% 69 85.5% 2.71 (1.18, 6.24) 0.0164 -17.0 (-30.5 - -3.5)
Sex
F 78 40 62.5% 38 94.7% 10.80 (2.27, 51.45) 0.0006 -32.2 (-48.8 - -15.6)
M 64 33 75.8% 31 74.2% 0.92 (0.30, 2.85) 0.8852 1.6 (-19.7 - 22.8)
Stratification Factor 2
S1 73 34 70.6% 39 87.2% 2.83 (0.86, 9.35) 0.0801 -16.6 (-35.2 - 2.0)
S2 69 39 66.7% 30 83.3% 2.50 (0.78, 8.04) 0.1181 -16.7 (-36.6 - 3.3)
B: Placebo A: Drug X
Prop. Diff
Baseline Risk Factors Total n n Response (%) n Response (%) Odds Ratio 95% CI p-value (Chi-Squared Test) (95% CI)
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
All Patients 142 73 68.5% 69 85.5% 2.71 (1.18, 6.24) 0.0164 -17 (-31 - -4)
Sex
F 78 40 62.5% 38 94.7% 10.80 (2.27, 51.45) 0.0006 -32 (-49 - -16)
M 64 33 75.8% 31 74.2% 0.92 (0.30, 2.85) 0.8852 2 (-20 - 23)
Stratification Factor 2
S1 73 34 70.6% 39 87.2% 2.83 (0.86, 9.35) 0.0801 -17 (-35 - 2)
S2 69 39 66.7% 30 83.3% 2.50 (0.78, 8.04) 0.1181 -17 (-37 - 3)

24 changes: 12 additions & 12 deletions tests/testthat/_snaps/survival_duration_subgroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,16 @@
Code
res
Output
B: Placebo A: Drug X
Prop. Diff
Baseline Risk Factors Total Events Events Median (DAYS) Events Median (DAYS) Hazard Ratio 95% Wald CI (95% CI)
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
All Patients 101 57 727.8 44 974.6 0.71 (0.48, 1.06) 14.3 (-0.5 - 29.1)
Sex
F 55 31 599.2 24 1016.3 0.56 (0.32, 0.96) 14.3 (-5.7 - 34.4)
M 46 26 888.5 20 974.6 0.91 (0.50, 1.65) 14.3 (-7.6 - 36.1)
Continuous Level Biomarker 2
LOW 36 21 735.5 15 974.6 0.76 (0.39, 1.51) 29.8 (6.7 - 53.0)
MEDIUM 31 14 731.8 17 964.2 0.77 (0.36, 1.61) -4.5 (-31.6 - 22.5)
HIGH 34 22 654.8 12 1016.3 0.67 (0.33, 1.36) 14.0 (-11.7 - 39.7)
B: Placebo A: Drug X
Prop. Diff
Baseline Risk Factors Total Events Events Median (DAYS) Events Median (DAYS) Hazard Ratio 95% Wald CI (95% CI)
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
All Patients 101 57 727.8 44 974.6 0.71 (0.48, 1.06) 14 (-0 - 29)
Sex
F 55 31 599.2 24 1016.3 0.56 (0.32, 0.96) 14 (-6 - 34)
M 46 26 888.5 20 974.6 0.91 (0.50, 1.65) 14 (-8 - 36)
Continuous Level Biomarker 2
LOW 36 21 735.5 15 974.6 0.76 (0.39, 1.51) 30 (7 - 53)
MEDIUM 31 14 731.8 17 964.2 0.77 (0.36, 1.61) -5 (-32 - 23)
HIGH 34 22 654.8 12 1016.3 0.67 (0.33, 1.36) 14 (-12 - 40)

3 changes: 2 additions & 1 deletion tests/testthat/test-response_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ testthat::test_that("tabulate_rsp_subgroups riskdiff argument works as expected"
riskdiff = control_riskdiff(
arm_x = levels(df$prop$arm)[1],
arm_y = levels(df$prop$arm)[2],
col_label = "Prop. Diff\n(95% CI)"
col_label = "Prop. Diff\n(95% CI)",
format = "xx. (xx. - xx.)"
)
)

Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-survival_duration_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ testthat::test_that("tabulate_survival_subgroups riskdiff argument works as expe
df,
time_unit = adtte$AVALU[1],
riskdiff = control_riskdiff(
col_label = "Prop. Diff\n(95% CI)"
col_label = "Prop. Diff\n(95% CI)",
format = "xx. (xx. - xx.)"
)
)

Expand Down
Loading