Skip to content
Draft
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
2 changes: 1 addition & 1 deletion R/count_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ count_values <- function(lyt,
table_names = vars,
.stats = "count_fraction",
.stat_names = NULL,
.formats = c(count_fraction = "xx (xx.xx%)", count = "xx"),
.formats = c(count_fraction = "xx (xx.x%)", count = "xx"),
.labels = c(count_fraction = paste(values, collapse = ", ")),
.indent_mods = NULL) {
# Process standard extra arguments
Expand Down
2 changes: 1 addition & 1 deletion R/estimate_multinomial_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ estimate_multinomial_response <- function(lyt,
table_names = var,
.stats = "prop_ci",
.stat_names = NULL,
.formats = list(prop_ci = "(xx.xx, xx.xx)"),
.formats = list(prop_ci = "(xx.x, xx.x)"),
.labels = NULL,
.indent_mods = NULL) {
# Process standard extra arguments
Expand Down
2 changes: 1 addition & 1 deletion R/incidence_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ estimate_incidence_rate <- function(lyt,
table_names = vars,
.stats = c("person_years", "n_events", "rate", "rate_ci"),
.stat_names = NULL,
.formats = list(rate = "xx.xx", rate_ci = "(xx.xx, xx.xx)"),
.formats = list(rate = "xx.x", rate_ci = "(xx.x, xx.x)"),
.labels = NULL,
.indent_mods = NULL) {
# Process standard extra arguments
Expand Down
8 changes: 4 additions & 4 deletions R/logistic_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,12 @@ logistic_summary_by_flag <- function(flag_var, na_str = default_na_str(), .inden
checkmate::assert_string(flag_var)
function(lyt) {
cfun_list <- list(
df = cfun_by_flag("df", flag_var, format = "xx.", .indent_mods = .indent_mods),
estimate = cfun_by_flag("estimate", flag_var, format = "xx.xxx", .indent_mods = .indent_mods),
std_error = cfun_by_flag("std_error", flag_var, format = "xx.xxx", .indent_mods = .indent_mods),
df = cfun_by_flag("df", flag_var, format = "xx.x", .indent_mods = .indent_mods),
estimate = cfun_by_flag("estimate", flag_var, format = "xx.xx", .indent_mods = .indent_mods),
std_error = cfun_by_flag("std_error", flag_var, format = "xx.xx", .indent_mods = .indent_mods),
odds_ratio = cfun_by_flag("odds_ratio", flag_var, format = ">999.99", .indent_mods = .indent_mods),
ci = cfun_by_flag("ci", flag_var, format = format_extreme_values_ci(2L), .indent_mods = .indent_mods),
pvalue = cfun_by_flag("pvalue", flag_var, format = "x.xxxx | (<0.0001)", .indent_mods = .indent_mods)
pvalue = cfun_by_flag("pvalue", flag_var, format = "x.xxx | (<0.0001)", .indent_mods = .indent_mods)
)
summarize_row_groups(
lyt = lyt,
Expand Down
10 changes: 5 additions & 5 deletions R/summarize_change.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ summarize_change <- function(lyt,
.stats = c("n", "mean_sd", "median", "range"),
.stat_names = NULL,
.formats = c(
mean_sd = "xx.xx (xx.xx)",
mean_se = "xx.xx (xx.xx)",
median = "xx.xx",
range = "xx.xx - xx.xx",
mean_pval = "xx.xx"
mean_sd = "xx.x (xx.x)",
mean_se = "xx.x (xx.x)",
median = "xx.x",
range = "xx.x - xx.x",
mean_pval = "xx.x"
),
.labels = NULL,
.indent_mods = NULL) {
Expand Down
2 changes: 1 addition & 1 deletion R/summarize_coxreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ summarize_coxreg <- function(lyt,
common_var = "STUDYID",
.stats = c("n", "hr", "ci", "pval", "pval_inter"),
.formats = c(
n = "xx", hr = "xx.xx", ci = "(xx.xx, xx.xx)",
n = "xx", hr = "xx.x", ci = "(xx.xx, xx.xx)",
pval = "x.xxxx | (<0.0001)", pval_inter = "x.xxxx | (<0.0001)"
),
varlabels = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/survival_timepoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ surv_timepoint <- function(lyt,
"rate_diff", "rate_diff_ci", "ztest_pval"
),
.stat_names = NULL,
.formats = list(rate_ci = "(xx.xx, xx.xx)"),
.formats = list(rate_ci = "(xx.x, xx.x)"),
.labels = NULL,
.indent_mods = if (method == "both") {
c(rate_diff = 1L, rate_diff_ci = 2L, ztest_pval = 2L)
Expand Down
140 changes: 70 additions & 70 deletions R/utils_default_stats_formats_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -608,82 +608,82 @@ tern_default_stats <- list(
#' @export
tern_default_formats <- c(
ci = list(format_extreme_values_ci(2L)),
count = "xx.",
count = "xx.x",
count_fraction = format_count_fraction,
count_fraction_fixed_dp = format_count_fraction_fixed_dp,
cv = "xx.x",
event_free_rate = "xx.xx",
cv = "xx.xx",
event_free_rate = "xx.xxx",
fraction = format_fraction_fixed_dp,
geom_cv = "xx.x",
geom_mean = "xx.x",
geom_mean_ci = "(xx.xx, xx.xx)",
geom_mean_ci_3d = "xx.xx (xx.xx - xx.xx)",
geom_mean_sd = "xx.x (xx.x)",
geom_sd = "xx.x",
geom_cv = "xx.xx",
geom_mean = "xx.xx",
geom_mean_ci = "(xx.x, xx.x)",
geom_mean_ci_3d = "xx.x (xx.x - xx.x)",
geom_mean_sd = "xx.xx (xx.xx)",
geom_sd = "xx.xx",
hr = list(format_extreme_values(2L)),
hr_ci = "(xx.xx, xx.xx)",
hr_ci_3d = "xx.xx (xx.xx - xx.xx)",
iqr = "xx.x",
lsmean = "xx.xx",
lsmean_diff = "xx.xx",
lsmean_diff_ci = "(xx.xx, xx.xx)",
mad = "xx.x",
max = "xx.x",
mean = "xx.x",
mean_ci = "(xx.xx, xx.xx)",
mean_ci_3d = "xx.xx (xx.xx - xx.xx)",
mean_pval = "x.xxxx | (<0.0001)",
mean_sd = "xx.x (xx.x)",
mean_sdi = "(xx.xx, xx.xx)",
mean_se = "xx.x (xx.x)",
mean_sei = "(xx.xx, xx.xx)",
median = "xx.x",
median_ci = "(xx.xx, xx.xx)",
median_ci_3d = "xx.xx (xx.xx - xx.xx)",
median_range = "xx.x (xx.x - xx.x)",
min = "xx.x",
n = "xx.",
n_blq = "xx.",
n_events = "xx",
n_patients = "xx (xx.x%)",
n_prop = "xx (xx.x%)",
n_rate = "xx (xx.x)",
n_rsp = "xx",
n_tot = "xx",
n_tot_events = "xx",
n_unique = "xx",
nonunique = "xx",
hr_ci = "(xx.x, xx.x)",
hr_ci_3d = "xx.x (xx.x - xx.x)",
iqr = "xx.xx",
lsmean = "xx.x",
lsmean_diff = "xx.x",
lsmean_diff_ci = "(xx.x, xx.x)",
mad = "xx.xx",
max = "xx.xx",
mean = "xx.xx",
mean_ci = "(xx.x, xx.x)",
mean_ci_3d = "xx.x (xx.x - xx.x)",
mean_pval = "x.xxx | (<0.0001)",
mean_sd = "xx.xx (xx.xx)",
mean_sdi = "(xx.x, xx.x)",
mean_se = "xx.xx (xx.xx)",
mean_sei = "(xx.x, xx.x)",
median = "xx.xx",
median_ci = "(xx.x, xx.x)",
median_ci_3d = "xx.x (xx.x - xx.x)",
median_range = "xx.xx (xx.xx - xx.xx)",
min = "xx.xx",
n = "xx.x",
n_blq = "xx.x",
n_events = "xx.x",
n_patients = "xx.x (xx.xx%)",
n_prop = "xx (xx.xx%)",
n_rate = "xx (xx.xx)",
n_rsp = "xx.x",
n_tot = "xx.x",
n_tot_events = "xx.x",
n_unique = "xx.x",
nonunique = "xx.x",
or = list(format_extreme_values(2L)),
or_ci = "xx.xx (xx.xx - xx.xx)",
person_years = "xx.x",
prop = "xx.x%",
prop_ci = "(xx.x, xx.x)",
pt_at_risk = "xx",
pval = "x.xxxx | (<0.0001)",
pvalue = "x.xxxx | (<0.0001)",
pval_counts = "x.xxxx | (<0.0001)",
quantiles = "xx.x - xx.x",
quantiles_lower = "xx.xx (xx.xx - xx.xx)",
quantiles_upper = "xx.xx (xx.xx - xx.xx)",
range = "xx.x - xx.x",
range_censor = "xx.x to xx.x",
range_event = "xx.x to xx.x",
rate = "xx.xxxx",
rate_ci = "(xx.xxxx, xx.xxxx)",
rate_diff = "xx.xx",
rate_diff_ci = "(xx.xx, xx.xx)",
rate_diff_ci_3d = format_xx("xx.xx (xx.xx, xx.xx)"),
rate_ratio = "xx.xxxx",
rate_ratio_ci = "(xx.xxxx, xx.xxxx)",
rate_se = "xx.xx",
riskdiff = "xx.x (xx.x - xx.x)",
sd = "xx.x",
se = "xx.x",
sum = "xx.x",
sum_exposure = "xx",
or_ci = "xx.x (xx.x - xx.x)",
person_years = "xx.xx",
prop = "xx.xx%",
prop_ci = "(xx.xx, xx.xx)",
pt_at_risk = "xx.x",
pval = "x.xxx | (<0.0001)",
pvalue = "x.xxx | (<0.0001)",
pval_counts = "x.xxx | (<0.0001)",
quantiles = "xx.xx - xx.xx",
quantiles_lower = "xx.x (xx.x - xx.x)",
quantiles_upper = "xx.x (xx.x - xx.x)",
range = "xx.xx - xx.xx",
range_censor = "xx.xx to xx.xx",
range_event = "xx.xx to xx.xx",
rate = "xx.xxx",
rate_ci = "(xx.xxx, xx.xxx)",
rate_diff = "xx.x",
rate_diff_ci = "(xx.x, xx.x)",
rate_diff_ci_3d = format_xx("xx.x (xx.x, xx.x)"),
rate_ratio = "xx.xxx",
rate_ratio_ci = "(xx.xxx, xx.xxx)",
rate_se = "xx.x",
riskdiff = "xx.xx (xx.xx - xx.xx)",
sd = "xx.xx",
se = "xx.xx",
sum = "xx.xx",
sum_exposure = "xx.x",
unique = format_count_fraction_fixed_dp,
unique_count = "xx",
ztest_pval = "x.xxxx | (<0.0001)"
unique_count = "xx.x",
ztest_pval = "x.xxx | (<0.0001)"
)

# tern_default_labels ----------------------------------------------------------
Expand Down
Loading