compare2qualvars: Comparison for columns of factors for 2 groups

Description Usage Arguments Value Examples

Description

compare2qualvars computes fisher.test with simulated p-value and descriptive statistics for a group of categorical dependent variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
compare2qualvars(
  data,
  dep_vars,
  indep_var,
  round_p = 3,
  round_desc = 2,
  pretext = FALSE,
  mark = FALSE,
  singleline = FALSE,
  spacer = " ",
  linebreak = "\n"
)

Arguments

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.

Value

A tibble with variable names, descriptive statistics, and p-value, number of rows is number of dep_vars.

Examples

1
2
3
4
5
6
7
8
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
)

wrappedtools documentation built on Sept. 6, 2021, 5:08 p.m.