DemographicTable: Demographic Table

View source: R/DemographicTable.R

DemographicTableR Documentation

Demographic Table

Description

To create a demographic table with simple summary statistics, with optional comparison(s) over one or more groups.

Usage

DemographicTable(data, data.name = substitute(data), by = NULL, ...)

Arguments

data

a data.frame

data.name

character scalar, or the argument call of data. A user-friendly name of the input data.

by

one-sided formula, the name(s) of sub-group(s) for which the summary statistics are provided. Default NULL indicating no sub-groups.

...

additional parameters, currently not in use

Details

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), 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).

Value

The function DemographicTable() returns an object of S3 class 'DemographicTable', which is a listof 'sumtab' elements.


DemographicTable documentation built on Sept. 26, 2026, 1:07 a.m.