tbl_reg_summary {gtreg} | R Documentation |
Data Summary Table
Description
Function wraps gtsummary::tbl_summary()
to create a data summary
table often seen in regulatory submissions. Continuous variable summaries
are shown on multiple lines with additional summary statistics and percentages
are shown for categorical variables; precision levels estimated based on values observed.
Usage
tbl_reg_summary(
data,
by = NULL,
label = NULL,
statistic = NULL,
digits = NULL,
type = NULL,
value = NULL,
missing = c("no", "yes", "ifany"),
missing_text = NULL,
sort = NULL,
percent = NULL,
include = everything()
)
Arguments
data |
A data frame |
by |
A column name (quoted or unquoted) in |
label |
List of formulas specifying variables labels,
e.g. |
statistic |
List of formulas specifying types of summary statistics to display for each variable. |
digits |
List of formulas specifying the number of decimal
places to round summary statistics. If not specified,
|
type |
List of formulas specifying variable types.
Accepted values are |
value |
List of formulas specifying the value to display for dichotomous
variables. gtsummary selectors, e.g. |
missing |
Indicates whether to include counts of |
missing_text |
String to display for count of missing observations.
Default is |
sort |
List of formulas specifying the type of sorting to perform for
categorical data. Options are |
percent |
Indicates the type of percentage to return. Must be one of
|
include |
variables to include in the summary table. Default is |
Value
a 'tbl_reg_summary' object
Example Output
Example 1
See Also
See gtsummary::tbl_summary()
help file
See vignette for detailed tutorial
Examples
tbl_reg_summary_ex1 <-
df_patient_characteristics %>%
tbl_reg_summary(by = trt, include = c(marker, status))