get_desc_stat_grouping | R Documentation |
This function generates descriptive statistics for the whole sample and stratified by a grouping variable. The grouping variable cannot have NA. For all other categorical variables, NA will be replaced with Unknown.
get_desc_stat_grouping(
dat,
grouping,
test = T,
raw = F,
median_vars = NULL,
detail = F,
detail_simple = F,
highlight = F,
highlight_p = 0.05,
paired = F,
sort = F,
dichotomize = F
)
dat |
A dataframe |
grouping |
A string, the name of the grouping variable |
test |
if you want to perform statistical testing, default is True |
raw |
if you want to get dataframe raw output, default is False |
median_vars |
specify the variables that need median(IQR) instead of mean(SD) |
detail |
if you want to get all the descriptive stat for continuous variables, default is F |
detail_simple |
if you want to get all the descriptive stat in a condensed version for continuous variables, default is F |
highlight |
logical, highlight=T highlights p values, default is F |
highlight_p |
a numeric value of the p value cutoff to highlight, default is 0.05 |
paired |
logical, paired=T uses wilcoxon signed rank tests, default is F |
sort |
logical, sort =T sorts the variables based on their sequence in the data, default is F, which puts continuous variables first |
dichotomize |
logical, dichotomize =T calculates p values for each dichotomized version of a categorical variable with overall difference of p<highlight_p,defalt is F |
A html table for descriptive statistics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.