tbl_ard_continuous {gtsummary} | R Documentation |
Summarize continuous variable
Description
Summarize a continuous variable by one or more categorical variables
Usage
tbl_ard_continuous(
cards,
variable,
include,
by = NULL,
statistic = everything() ~ "{median} ({p25}, {p75})"
)
Arguments
cards |
( |
variable |
( |
include |
( |
by |
( |
statistic |
( |
Value
a gtsummary table of class "tbl_ard_summary"
Examples
library(cards)
bind_ard(
# the primary ARD with the results
ard_continuous(
trial,
# the order variables are passed here is important.
# 'trt' is the column stratifying variable and needs to be listed first.
by = c(trt, grade),
variables = age
) ,
# add univariate trt tabulation
ard_categorical(
trial,
variables = trt
),
# add missing and attributes ARD
ard_missing(
trial,
by = c(trt, grade),
variables = age
),
ard_attributes(
trial,
variables = c(trt, grade, age)
)
) |>
tbl_ard_continuous(by = "trt", variable = "age", include = "grade")
bind_ard(
# the primary ARD with the results
ard_continuous(trial, by = grade, variables = age),
# add missing and attributes ARD
ard_missing(trial, by = grade, variables = age),
ard_attributes(trial, variables = c(grade, age))
) |>
tbl_ard_continuous(variable = "age", include = "grade")
[Package gtsummary version 2.0.0 Index]