compare_n_qualvars | R Documentation |
Comparison for columns of factors for more than 2 groups with post-hoc
compare_n_qualvars(
data,
dep_vars,
indep_var,
round_p = 3,
round_desc = 2,
pretext = FALSE,
mark = FALSE,
singleline = FALSE,
spacer = " ",
linebreak = "\n",
prettynum = FALSE
)
data |
name of data set (tibble/data.frame) to analyze. |
dep_vars |
vector of column names. |
indep_var |
name of grouping variable. |
round_p |
level for rounding p-value. |
round_desc |
number of significant digits for rounding of descriptive stats |
pretext |
for function formatP |
mark |
for function formatP |
singleline |
Put all group levels in a single line? |
spacer |
Text element to indent levels, defaults to " ". |
linebreak |
place holder for newline. |
prettynum |
Apply prettyNum to results? |
A tibble with variable names, descriptive statistics, and p-value of fisher.test and pairwise_fisher_test, number of rows is number of dep_vars.
# Separate lines for each factor level:
compare_n_qualvars(
data = mtcars, dep_vars = c("am", "cyl", "carb"), indep_var = "gear",
spacer = " "
)
# All levels in one row but with linebreaks:
compare_n_qualvars(
data = mtcars, dep_vars = c("am", "cyl", "carb"), indep_var = "gear",
singleline = TRUE
)
# All levels in one row, separateted by ";":
compare_n_qualvars(
data = mtcars, dep_vars = c("am", "cyl", "carb"), indep_var = "gear",
singleline = TRUE, linebreak = "; "
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.