summary_functions  R Documentation 
continuous_summary_fns()
returns a named list of summary functions
for continuous variables. Some functions include slight modifications to
their base equivalents. For example, the min()
and max()
functions
return NA
instead of Inf
when an empty vector is passed.
Statistics "p25"
and "p75"
are calculated with quantile(type = 2)
,
which matches
SAS's default value.
categorical_summary_fns()
returns a named list of summary statistics for
categorical variables. Options are "n"
, "N"
, and "p"
. If a user requests, for
example, only "p"
, the function will return "n"
and "N"
as well, since they are
needed to calculate "p"
. These statistics will be stored as a vector within the
tabulation
list element.
missing_summary_fns()
returns a named list of summary functions suitable
for variablelevel summaries, such as number and rate of missing data.
continuous_summary_fns(
summaries = c("N", "mean", "sd", "median", "p25", "p75", "min", "max"),
other_stats = NULL
)
categorical_summary_fns(summaries = c("n", "p", "N"), other_stats = NULL)
missing_summary_fns(
summaries = c("N_obs", "N_miss", "N_nonmiss", "p_miss", "p_nonmiss")
)
summaries 
(

other_stats 
(named 
continuous_summary_fns()
and missing_summary_fns()
return a named list of summary
functions, categorical_summary_fns()
returns a named list of summary statistics.
# continuous variable summaries
ard_continuous(
ADSL,
variables = "AGE",
statistic = ~ continuous_summary_fns(c("N", "median"))
)
# categorical variable summaries
ard_categorical(
ADSL,
variables = "AGEGR1",
statistic = ~ categorical_summary_fns(c("n", "N"))
)
# summary for rates of missing data
ard_missing(
ADSL,
variables = c("AGE", "AGEGR1"),
statistic = ~ missing_summary_fns()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.