Table 1 (baseline characteristics) stratified by group
Usage
table1(
data,
group_col = NULL,
continuous_vars = NULL,
categorical_vars = NULL,
continuous_summary = c("mean_sd", "median_iqr", "mean_ci"),
show_p = TRUE,
show_smd = TRUE,
show_missing = TRUE,
weights = NULL,
digits = 2L,
apa = FALSE,
output_format = "dataframe",
title = "Table 1. Baseline Characteristics"
)Arguments
- data
Data frame.
- group_col
Column defining groups, or NULL.
- continuous_vars
Continuous variable names (auto-detect numeric non-group columns if NULL).
- categorical_vars
Categorical names (auto-detect character / factor / logical if NULL).
- continuous_summary
"mean_sd", "median_iqr" or "mean_ci".
- show_p
Include p-value column.
- show_smd
Include SMD column (2 groups only).
- show_missing
Include missing count.
- weights
Column name for survey weights or NULL.
- digits
Decimal places.
- apa
APA-style p-value formatting.
- output_format
"dataframe", "latex", "html", "markdown", "text", "csv".
- title
Table title.