Compute custom statistics specified by the user.
getStatisticsSummaryStatisticsTable(
summaryTable,
statsVarInit,
var = NULL,
stats = NULL,
statsVarBy = NULL
)
List with two elements:
'summaryTable': summary table updated with statistics specified in stats
'statsVar': Character vector with statistics names
Summary table.
Character vector with initial statistics names.
Character vector with variable(s) of data
,
to compute statistics on.
If NULL (by default), counts by row/column variable(s) are computed.
To also return counts of the rowVar
in case other var
are specified, you can include: 'all' in the var
.
Missing values, if present, are filtered
(also for the report of number of subjects/records).
(Optionally) named list of expression or call object of summary statistics of interest. The names are reported in the header. The following variables are recognized, if the table is a:
'summaryTable':
'statN': number of subjects
'statMean': mean of var
'statSD': standard deviation of var
'statSE': standard error of var
'statMedian': median of var
'statMin': minimum of var
'statMax': maximum of var
'statPerc': percentage of subjects
'statm': number of records
'countTable':
'statN': number of subjects
'statPercN': percentage of subjects
'statm': number of records
If stats
if of length 1, the name of the summary statistic is not included
in the table.
The statistics can be specified for each var
(if multiple),
by naming each element of the list:
list(varName1 = list(...), varName2 = list()) and/or for each element in:
statsVarBy
, by naming each sublist.
Character vector with colnames of
data
by which the statistics should be computed.
In this case, stats
(nested list or not) should be additionally nested
to specify the statistics for each element in statsVarBy
.
Laure Cougnaud