Creates baseline prevalence and post-baseline incidence sections for ADA/NAb data. For multi-arm data, original treatment columns are retained, optional custom pooled columns are added, and a Total column is always added.
tbl_ada_summary(
data,
by = NULL,
pools = NULL,
total_label = "All Patients",
keep_original = TRUE,
null_postbaseline = NULL,
baseline_header = "Baseline Prevalence of NAbs",
postbaseline_header = "Incidence of NAbs",
baseline_label = list(ADABLPFL = "Baseline evaluable patients for ADA", adaposbl =
"Patients with a positive ADA sample at baseline", nabevalbase =
"Baseline evaluable patients for NAb", nabposbl =
"Patients with a positive NAb sample at baseline", nabnegbl =
"Patients with no positive NAb sample at baseline"),
postbaseline_label = list(ADPBLPFL = "Post-baseline evaluable patients for ADA",
adastatpos = "Patients positive for ADA", nabpbeval =
"Post-baseline evaluable patients for NAb", nabstatpos = "Patients positive for NAb",
nabstatneg = "Patients negative for NAb"),
add_blank_row = FALSE
)(data.frame)
A data frame containing ADAT variables.
(string or NULL)
A single treatment/grouping variable, or NULL for an unstratified table.
(list or NULL)
An optional named list of custom pooled columns passed to
tbl_with_pools(). For example,
list("Xanomeline Dosed" = c("High Dose", "Low Dose")).
(string)
Display label for the Total column.
(logical)
Whether original treatment columns are retained when calculated columns
are added.
(character or NULL)
Character vector of displayed column labels to blank in the post-baseline
section. This can include original treatment columns, custom pooled
columns, and the Total column. Use NULL to retain all post-baseline
values.
(string)
Header for the baseline section.
(string)
Header for the post-baseline section.
(list or NULL)
Optional named list of baseline variable labels.
(list or NULL)
Optional named list of post-baseline variable labels.
(logical)
Whether to insert a blank row between the baseline and post-baseline
sections. Default is FALSE.
A tbl_ada_summary and gtsummary object.
# Minimal ADAT-like dataset with three arms
df <- data.frame(
USUBJID = paste0("S", 1:15),
TRT = rep(c("Drug A", "Drug B", "Placebo"), each = 5),
ADABLPFL = c(rep("Y", 13), "N", "N"),
adaposbl = c(rep("Y", 4), rep("N", 11)),
nabevalbase = c(rep("Y", 14), "N"),
nabposbl = c(rep("Y", 3), rep("N", 12)),
nabnegbl = c(rep("N", 3), rep("Y", 12)),
ADPBLPFL = c(rep("Y", 13), "N", "N"),
adastatpos = c(rep("Y", 4), rep("N", 11)),
nabpbeval = c(rep("Y", 14), "N"),
nabstatpos = c(rep("Y", 3), rep("N", 12)),
nabstatneg = c(rep("N", 3), rep("Y", 12)),
stringsAsFactors = FALSE
)
# Pool two active arms; blank post-baseline for Placebo and All Patients
tbl_ada_summary(
df,
by = "TRT",
pools = list("Drug A+B" = c("Drug A", "Drug B")),
total_label = "All Patients",
null_postbaseline = c("Placebo", "All Patients")
)
Drug A
(N = 5)
Drug B
(N = 5)
Placebo
(N = 5)
Drug A+B
(N = 10)
All Patients
(N = 15)
# Unstratified table (no by variable)
tbl_ada_summary(df, by = NULL)
Overall
(N = 15)