View source: R/tbl_ard_continuous.R
tbl_ard_continuous | R Documentation |
Summarize a continuous variable by one or more categorical variables
tbl_ard_continuous(
cards,
variable,
include,
by = NULL,
label = NULL,
statistic = everything() ~ "{median} ({p25}, {p75})",
value = NULL
)
cards |
( |
variable |
( |
include |
( |
by |
( |
label |
( |
statistic |
( |
value |
( |
a gtsummary table of class "tbl_ard_summary"
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")
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.