View source: R/computeSummaryStatistics.R
computeSummaryStatistics | R Documentation |
Additionally, this function run extra checks on the data:
an error message is triggered if any subject (identified by subjectVar
)
have different values in a continuous var
an indicative message is triggered if multiple but identical records are available
for subjectVar
and a continuous var
computeSummaryStatistics(
data,
var = NULL,
varTotalInclude = FALSE,
statsExtra = NULL,
subjectVar = "USUBJID",
filterEmptyVar = TRUE,
type = "auto",
checkVarDiffBySubj = c("error", "warning", "none"),
msgLabel = NULL,
msgVars = NULL
)
data |
Data.frame with dataset to consider for the summary table. |
var |
Character vector with variable(s) of |
varTotalInclude |
Logical (FALSE by default)
Should the total across all categories of |
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:
|
subjectVar |
String, variable of |
filterEmptyVar |
Logical, if TRUE doesn't return any results if the variable is empty, otherwise return 0 for the counts and NA for summary statistics. Criterias to consider a variable empty are:
By default, an empty variable are filtered. |
type |
String with type of table:
|
checkVarDiffBySubj |
String, 'error' (default), 'warning',
or 'none'.
Should an error, a warning, or nothing be produced
if a continuous variable ( |
msgLabel |
(optional) String with label for the data (NULL by default), included in the message/warning for checks. |
msgVars |
(optional) Character vector with columns of |
Data.frame with summary statistics in columns,
depending if type
is:
'summary':
'statN': number of subjects
'statm': number of records
'statMean': mean of var
'statSD': standard deviation of var
'statSE': standard error the mean of var
'statMedian': median of var
'statMin': minimum of var
'statMax': maximum of var
'count':
'variableGroup': factor with groups of var
for which counts are reported
'statN': number of subjects
'statm': number of records
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.