View source: R/cat_desc_table.R
cat_var_table | R Documentation |
This takes a set of categorical variables and a continuous dependent variable and produces a table that shows the distribution of data across the levels of the categorical variables, as well as the mean of the dependent variable for each level and the significance of pairwise comparisons between these means.
cat_var_table( df, dv, ..., var_names = NULL, level_names = NULL, p.adjust = p.adjust.methods, alpha_level = 0.05, filename = NULL, notes = list(), dv_name = NULL, bold_vars = TRUE, css_tags = list(), na.rm = TRUE, exclude_na = FALSE )
df |
Dataframe containing the variables specified |
dv |
The continuous dependent variable to be presented alongside the levels of categorical variables |
... |
Categorical variables to be included |
var_names |
Tibble of old and new variable names, if variables are to be renamed for display. See |
level_names |
Tibble of old and new level names, if levels are to be renamed for display. See |
p.adjust |
One of p.adjust.methods, defaults to Holm |
alpha_level |
The level of significance for the pairwise comparisons (after p.adjust). Defaults to .05 |
filename |
the file name to create on disk. Include '.html' extension to best preserve formatting (see gt::gtsave for details) |
notes |
List of notes to append to bottom of table. |
dv_name |
Optional. A different name to use for the dependent variable in the automatic table footnote explaining the M(SD) column. Defaults to dv variable name. |
bold_vars |
Should rows with variable names be bold. Defaults to TRUE |
css_tags |
List of css tags to be added, each named with the class that the tag should be added to. |
na.rm |
Should missing values be dropped in the dv when summary statistics are calculated? |
exclude_na |
Should cases that are NA on a categorical variable be dropped from that section? |
A list including a tibble of descriptive statistics ('descr'), the 'gt'-table ('tab') and the HTML code ('html') with 'css_tags' added
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.