View source: R/computeSummaryStatisticsTable.R
computeSummaryStatisticsTable | R Documentation |
Compute summary statistics for a specific dataset and variables of interest
computeSummaryStatisticsTable(
data,
var = NULL,
varFlag = NULL,
varInclude0 = FALSE,
varLab = NULL,
varLabInclude = length(var) > 1,
varGeneralLab = "Variable",
varSubgroupLab = "Variable group",
varIgnore = NULL,
varIncludeTotal = FALSE,
varTotalInclude = FALSE,
varTotalInSepRow = FALSE,
colVar = NULL,
colVarDataLevels = NULL,
colVarTotal = colVar,
colVarTotalPerc = colVarTotal,
colTotalInclude = FALSE,
colTotalLab = "Total",
colInclude0 = FALSE,
rowVar = NULL,
rowVarDataLevels = NULL,
rowVarLab = NULL,
rowOrder = "auto",
rowOrderTotalFilterFct = NULL,
rowOrderCatLast = NULL,
rowVarTotalInclude = NULL,
rowVarTotalInSepRow = NULL,
rowVarTotalByVar = NULL,
rowVarTotalPerc = NULL,
rowInclude0 = FALSE,
type = "auto",
subjectVar = "USUBJID",
dataTotal = NULL,
dataTotalPerc = dataTotal,
dataTotalRow = NULL,
dataTotalCol = NULL,
stats = NULL,
statsVarBy = NULL,
statsExtra = NULL,
statsGeneralLab = "Statistic",
statsPerc = c("statN", "statm"),
filterFct = NULL,
labelVars = NULL,
byVar = NULL,
byVarLab = NULL,
checkVarDiffBySubj = "error"
)
data |
Data.frame with dataset to consider for the summary table. |
var |
Character vector with variable(s) of |
varFlag |
Character vector, subset of |
varInclude0 |
Logical, should rows with no counts
for the count
|
varLab |
Named character vector with label for each variable
specified in |
varLabInclude |
Logical, if TRUE
the name of the summary statistic variable(s) ( |
varGeneralLab |
String with general label for variable specified in |
varSubgroupLab |
String with general label for sub-group of categorical variable(s) for count table, 'Variable group' by default. This will be included in the final table header (see 'rowVarLab' attribute of the output). |
varIgnore |
Vector with elements to ignore in the |
varIncludeTotal |
This argument is deprecated, please use: 'varTotalInclude' instead. |
varTotalInclude |
Should the total across all categories of
|
varTotalInSepRow |
Logical, should the total per variable be included in a separated row (by default) or in the row containing the header of the variable? |
colVar |
Character vector with variable(s) to be included in columns.
If multiple variables are specified, the variables should
be sorted in hierarchical order,
and are included in multi-columns layout. |
colVarDataLevels |
Data.frame with unique combinations of |
colVarTotal |
String with column(s) considered to compute the total by,
reported in the header of the table, by default same as |
colVarTotalPerc |
String with column(s) considered to compute the total by,
used as denominator for the percentage computation, by default same as |
colTotalInclude |
Logical, if TRUE (FALSE by default) include the summary statistics across columns in a separated column. |
colTotalLab |
String, label for the total column 'Total' by default. |
colInclude0 |
Logical, if TRUE (FALSE by default),
include columns with no records, based on all combinations
of the |
rowVar |
Character vector with variable(s) to be included in the rows. If multiple variables are specified, the variables should be sorted in hierarchical order (e.g. body system class before adverse event term) and are nested in the table. |
rowVarDataLevels |
Data.frame with unique combinations of |
rowVarLab |
Named character vector with
label for the |
rowOrder |
Specify how the rows should be ordered in the final table, either a:
To specify different ordering methods for different |
rowOrderTotalFilterFct |
Function used to filter the data used to order the rows
based on total counts (in case |
rowOrderCatLast |
String with category to be printed in the last
row of each |
rowVarTotalInclude |
Character vector with |
rowVarTotalInSepRow |
Character vector with |
rowVarTotalByVar |
Character vector with a row variable
used to categorize the row total. |
rowVarTotalPerc |
Character vector with row variables by which the total
should be computed for the denominator for the percentage computation.
By default the total is only computed only by column (NULL by default).
If the total should be based on the total number of records per variable,
|
rowInclude0 |
Logical, if TRUE (FALSE by default),
include rows with no records, based on all combinations
of the |
type |
String with type of table:
|
subjectVar |
String, variable of |
dataTotal |
Data.frame used to extract the Total number of subject
per column in column header ('N = [X]').
It should contain the variables specified by |
dataTotalPerc |
Data.frame used to extract the total counts per column
for the computation of the percentage. |
dataTotalRow |
Data.frame used to extract the total count across all
elements of the row
variable, list of such data.frame for each |
dataTotalCol |
Data.frame from which the total across columns is
extracted (in case
If only a subset of the variables is specified in this list,
By default, |
stats |
(optional) Statistic(s) of interest to compute, either:
|
statsVarBy |
String with variable in |
statsExtra |
(optional) Named list with functions for additional custom
statistics to be computed.
For example, to additionally compute the coefficient of variation, this can be set to:
|
statsGeneralLab |
String with general label for statistics, 'Statistic' by default.
Only included if no |
statsPerc |
String with 'base statistical variable' used to compute the percentage, either:
|
filterFct |
(optional) Function taking as input
the summary table with computed statistics and returning a subset
of the summary table.
|
labelVars |
(optional) Named character vector with label for
the row, column variable(s) or variable(s) to summarize. |
byVar |
Variable(s) of |
byVarLab |
String with label for |
checkVarDiffBySubj |
String, 'error' (default), 'warning',
or 'none'.
Should an error, a warning, or nothing be produced
if a continuous variable ( |
An object summaryTable
or list of such objects if
byVar
is specified.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.