compare2qualvars | R Documentation |
compare2qualvars
computes fisher.test with simulated p-value and
descriptive statistics for a group of categorical dependent variables.
compare2qualvars(
data,
dep_vars,
indep_var,
round_p = 3,
round_desc = 2,
pretext = FALSE,
mark = FALSE,
singleline = FALSE,
spacer = " ",
linebreak = "\n",
p_subgroups = FALSE
)
data |
name of data set (tibble/data.frame) to analyze. |
dep_vars |
vector of column names for dependent variables. |
indep_var |
name of grouping variable, has to translate to 2 groups. |
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 and fill empty cells, defaults to " ". |
linebreak |
place holder for newline. |
p_subgroups |
test subgroups by recoding other levels into other, default is not to do this. |
A tibble with variable names, descriptive statistics, and p-value, number of rows is number of dep_vars.
compare2qualvars(
data = mtcars, dep_vars = c("gear", "cyl", "carb"), indep_var = "am",
spacer = " "
)
compare2qualvars(
data = mtcars, dep_vars = c("gear", "cyl", "carb"), indep_var = "am",
spacer = " ", singleline = TRUE
)
compare2qualvars(
data = mtcars, dep_vars = c("gear", "cyl", "carb"), indep_var = "am",
spacer = " ", p_subgroups = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.