Usage
tbl_ard_continuous(
cards,
variable,
include,
by = NULL,
label = NULL,
statistic = everything() ~ "{median} ({p25}, {p75})",
value = NULL
)
Arguments
- cards
(
card
)
An ARD object of class"card"
typically created withcards::ard_*()
functions.- variable
(
string
)
A single variable name of the continuous variable being summarized.- include
(
character
)
Character vector of the categorical variables to- by
(
string
)
A single variable name of the stratifying variable.- label
(
formula-list-selector
)
Used to override default labels in summary table, e.g.list(age = "Age, years")
. The default for each variable is the column label attribute,attr(., 'label')
. If no label has been set, the column name is used.- statistic
(
formula-list-selector
)
Specifies summary statistics to display for each variable. The default iseverything() ~ "{median} ({p25}, {p75})"
.- value
(
formula-list-selector
)
Supply a value to display a variable on a single row, printing the results for the variable associated with the value (similar to a'dichotomous'
display intbl_summary()
).
Examples
library(cards)
# Example 1 ----------------------------------
# the primary ARD with the results
ard_continuous(
# the order variables are passed is important for the `by` variable.
# 'trt' is the column stratifying variable and needs to be listed first.
trial, by = c(trt, grade), variables = age
) |>
# adding OPTIONAL information about the summary variables
bind_ard(
# 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")
Characteristic
Drug A1
Drug B1
1 Age: Median (Q1, Q3)
# Example 2 ----------------------------------
# the primary ARD with the results
ard_continuous(trial, by = grade, variables = age) |>
# adding OPTIONAL information about the summary variables
bind_ard(
# 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")
Characteristic
Overall1
1 Age: Median (Q1, Q3)