tidysummary: An Elegant Approach to Summarizing Clinical Data.
The goal of tidysummary is to streamlines the analysis of clinical data by automatically selecting appropriate statistical descriptions and inference methods based on variable types.
A data frame containing the variables to analyze, with variables at columns and observations at rows:
Continuous variables: Numeric.
Categorical variables: Factor (Ordinal Categorical variables: ordered Factor).
The add_var() function prepares your dataset for downstream analysis by classifying variables into:
Continuous variables: Further subdivided by normality and equal variance assumptions.
Categorical variables: Further subdivided by ordered status and expected frequency.
Specify the variables to summarize in var
and the
grouping variable in group
.
The function can automatically checks normality using statistical tests. You can choose:
'auto'
: By default, automatically checks normality,
but the same as ask
when n > 1000.
'ask'
: Displays automatic result, QQ plots and
prompts for manual confirmation.
true
: Treats all variables as normal.
false
: Treats all variables as non-normal.
The add_summary() function summarize your dataset from add_var() result with:
A summary dataframe with rows as the variables and columns as the group.
Just input the result from add_var()
If you want to custom the summary style, You can choose:
TRUE
: By default, include an “Overall” summary
column.
FALSE
: Show only groups summary column.
Format string to override both norm_continuous_format
,
and unnorm_continuous_format
.
Accepted placeholders are '{mean}'
, '{SD}'
,
'{median}'
, '{Q1}'
, '{Q3}'
.
Default is '{mean} ± {SD}'
. Accepted placeholders same
as continuous_format
.
Default is '{median} ({Q1}, {Q3})'
. Accepted
placeholders same as continuous_format
.
Format string for categorical variables. Default is
'{n} ({pct})'
. Accepted placeholders are '{n}'
and '{pct}'
.
The add_summary() function summarize your dataset from add_summary() result with:
A summary_with_p dataframe with rows as the variables and columns as the group.
Just input the result from add_summary()
If you want to custom the summary_with_p column, You can choose:
TRUE
: Show asterisk significance markers.
FALSE
: By default, show p-values.
TRUE
: Show method text.
FALSE
: By default, not show method text.
'code'
: Show method as codes according to order of
appearance.
TRUE
: Show statistic name.
FALSE
: By default, not show statistic name.