column_stats {junco} | R Documentation |
Statistics within the column space
Description
A function factory used for obtaining statistics within the columns of your table. Used in change from baseline tables. This takes the visit names as its row labels.
Usage
column_stats(
exclude_visits = c("Baseline (DB)"),
var_names = c("AVAL", "CHG", "BASE"),
stats = list(main = c(N = "N", mean = "Mean", SD = "SD", SE = "SE", Med = "Med", Min =
"Min", Max = "Max"), base = c(mean = "Mean"))
)
Arguments
exclude_visits |
Vector of visit(s) for which you do not want the statistics displayed in the baseline mean or change from baseline sections of the table. |
var_names |
Vector of variable names to use instead of the default AVAL, CHG, BASE. The first two elements are treated as main variables with full statistics, and the third element is treated as the base variable. By default, the function expects these specific variable names in your data, but you can customize them to match your dataset's column names. |
stats |
A list with two components, |
Value
an analysis function (for use with rtables::analyze) implementing the specified statistics.