Create a demographic table with simple summary statistics, with optional comparison(s) over one or more groups.
DemographicTable(
data,
data.name = substitute(data),
groups = NULL,
exclude = NULL,
exclude_rx,
include,
include_rx,
robust = TRUE,
overall = TRUE,
compare = TRUE,
pairwise = 3L,
...
)
Function DemographicTable()
returns an object of S3 class 'DemographicTable'
,
which is a listof
'sumtab'
elements.
character scalar, or the argument call of data
.
A user-friendly name of the input data
.
character scalar or vector,
the name(s) of sub-group(s) for which the summary statistics are provided.
Default NULL
indicating no sub-groups.
character vector,
the name(s) of variable(s) to be excluded.
Default NULL
indicating no variable are excluded.
(optional) regex, pattern of the names of the variable(s) to be excluded.
character vector,
the name(s) of variable(s) to be included.
Default names(data)
indicating all variables are included.
(optional) regex, pattern of the names of the variable(s) to be included.
logical scalar.
If TRUE
(default), use non-parametric methods for
non-normally distributed numeric variables.
logical scalar.
If TRUE
(default), a column of overall summary statistics will be provided.
logical scalar.
If TRUE
(default), comparisons between group(s) will be made.
integer scalar,
minimum number of groups where pairwise comparisons need to be performed.
Default 3L
.
additional parameters, currently not in use
A demographic table with simple summary statistics, with optional comparison(s) over one or more groups, is created.
numeric variables are summarized in means, standard deviations, medians, inter-quartile-ranges (IQR),
skewness, \(p\)-value of Shapiro-Wilk normality test and ranges.
If group
is specified, they are compared using two-sample t.test,
wilcox.test (Wilcoxon / Mann-Whitney), one-way aov (ANOVA) and/or
kruskal.test (Kruskal-Wallis).
logical and factor variables are summarized in counts and percentages.
If group
is specified, they are compared using prop.test (chi-squared)
and/or fisher.test (Fisher's exact).