| statlist | R Documentation |
statlist interface for a tableThe statlist is the interface for the presentation of data in a tidytlg
table.
statlist(stats, ...)
stats |
(required) A character vector of statistics to display in the table. |
... |
(optional) Additional configuration for stats. See sections below for allowable arguments. |
A statlist object that can be passed in the statlist argument of
freq, nested_freq, or univar.
Statlists for freq() and nested_freq()freq() statlists can be composed of n (count), N (denominator), and
x.x (percentage, formatted with or without a percent sign).
Denominators will include missing values if the 'display_missing'
argument is TRUE, otherwise they will be excluded. They can be arranged
in the following ways:
n
n/N
n (x.x)
n (x.x%)
n/N (x.x)
n/N (x.x%)
The following other configurations are supported:
denoms_by - Controls what groupings of variables should define the
denominator. Variables should be passed as a quoted vector
distinct - A boolean value. Should the numerator reflect distinct
USUBJIDs or event counts. Defaults to TRUE which captures distinct
subjects.
distinct_by - A character value used to select the variable that
should be used to "distinct" the frequency tables. Defaults to USUBJID.
zero_denom - The string to display when there are no records found
in an entire denominator group. Defaults to -
zero_n - The string to display when there are no records found for
a numerator. Defaults to 0.
Statlists for univar statlistsN
SUM
MEAN
GeoMEAN
SD
SE
CV
GSD
GSE
MEANSD
MEANSE
MEDIAN
MIN
MAX
RANGE
Q1
Q3
IQRANGE
MEDRANGE
MEDIQRANGE
MEAN_CI
GeoMEAN_CI
where GeoMEAN: Geometric Mean, CV: Coefficient of Variation,
GSD: Geometric standard deviation, GSE: Geometric standard error,
MEAN_CI: Mean (95% C.I.), GeoMEAN_CI: Geometric Mean (95% C.I.).
In calculating geometric statistics, if there
are zero values in the inputs, zero values will be excluded before
calculating geometric statistics.
freq(
mtcars,
colvar = "gear",
rowvar = "cyl",
rowbyvar = "am",
statlist = statlist("n/N (x.x)",
distinct = FALSE,
denoms_by = c("gear", "am"),
zero_denom = "_0_"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.