From 27e08f652be68bc4db1a9379222585b33567f3a3 Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Tue, 21 May 2024 14:47:15 -0400 Subject: [PATCH] Untransform standard error --- R/ard_survival_survfit.R | 4 ++-- tests/testthat/_snaps/ard_survival_survfit.md | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/ard_survival_survfit.R b/R/ard_survival_survfit.R index 8b44c735b..e430eedc0 100644 --- a/R/ard_survival_survfit.R +++ b/R/ard_survival_survfit.R @@ -194,7 +194,7 @@ ard_survival_survfit <- function(x, times = NULL, probs = NULL, type = NULL) { if (type != "survival") { df_stat <- df_stat %>% dplyr::mutate(dplyr::across( - any_of(c("estimate", "std.error", "conf.low", "conf.high")), + any_of(c("estimate", "conf.low", "conf.high")), if (type == "cumhaz") ~ -log(.x) else ~ 1 - .x )) %>% dplyr::rename(conf.low = "conf.high", conf.high = "conf.low") @@ -334,7 +334,7 @@ extract_multi_strata <- function(x, df_stat) { ~stat_name, ~stat_label, "n.risk", "Number of Subjects at Risk", "estimate", "Survival Probability", - "std.error", "Standard Error", + "std.error", "Standard Error (untransformed)", "conf.low", "CI Lower Bound", "conf.high", "CI Upper Bound", "conf.level", "CI Confidence Level", diff --git a/tests/testthat/_snaps/ard_survival_survfit.md b/tests/testthat/_snaps/ard_survival_survfit.md index 98d6a5288..7f2a2529d 100644 --- a/tests/testthat/_snaps/ard_survival_survfit.md +++ b/tests/testthat/_snaps/ard_survival_survfit.md @@ -53,32 +53,32 @@ group1 group1_level variable variable_level stat_name stat_label stat 1 TRTA Placebo time 60 n.risk Number o… 59 2 TRTA Placebo time 60 estimate Survival… 0.107 - 3 TRTA Placebo time 60 std.error Standard… 0.964 + 3 TRTA Placebo time 60 std.error Standard… 0.036 4 TRTA Placebo time 60 conf.high CI Upper… 0.175 5 TRTA Placebo time 60 conf.low CI Lower… 0.034 6 TRTA Placebo time 180 n.risk Number o… 35 7 TRTA Placebo time 180 estimate Survival… 0.349 - 8 TRTA Placebo time 180 std.error Standard… 0.939 + 8 TRTA Placebo time 180 std.error Standard… 0.061 9 TRTA Placebo time 180 conf.high CI Upper… 0.459 10 TRTA Placebo time 180 conf.low CI Lower… 0.217 11 TRTA Xanomeli… time 60 n.risk Number o… 14 12 TRTA Xanomeli… time 60 estimate Survival… 0.306 - 13 TRTA Xanomeli… time 60 std.error Standard… 0.929 + 13 TRTA Xanomeli… time 60 std.error Standard… 0.071 14 TRTA Xanomeli… time 60 conf.high CI Upper… 0.432 15 TRTA Xanomeli… time 60 conf.low CI Lower… 0.151 16 TRTA Xanomeli… time 180 n.risk Number o… 3 17 TRTA Xanomeli… time 180 estimate Survival… 0.738 - 18 TRTA Xanomeli… time 180 std.error Standard… 0.86 + 18 TRTA Xanomeli… time 180 std.error Standard… 0.14 19 TRTA Xanomeli… time 180 conf.high CI Upper… 0.908 20 TRTA Xanomeli… time 180 conf.low CI Lower… 0.251 21 TRTA Xanomeli… time 60 n.risk Number o… 20 22 TRTA Xanomeli… time 60 estimate Survival… 0.268 - 23 TRTA Xanomeli… time 60 std.error Standard… 0.932 + 23 TRTA Xanomeli… time 60 std.error Standard… 0.068 24 TRTA Xanomeli… time 60 conf.high CI Upper… 0.39 25 TRTA Xanomeli… time 60 conf.low CI Lower… 0.122 26 TRTA Xanomeli… time 180 n.risk Number o… 5 27 TRTA Xanomeli… time 180 estimate Survival… 0.619 - 28 TRTA Xanomeli… time 180 std.error Standard… 0.87 + 28 TRTA Xanomeli… time 180 std.error Standard… 0.13 29 TRTA Xanomeli… time 180 conf.high CI Upper… 0.805 30 TRTA Xanomeli… time 180 conf.low CI Lower… 0.257 Message