compare_n_qualvars: Comparison for columns of factors for more than 2 groups with...

Description Usage Arguments Value Examples

Description

Comparison for columns of factors for more than 2 groups with post-hoc

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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
)

Arguments

data

name of data set (tibble/data.frame) to analyze.

dep_vars

vector of column names.

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, defaults to " ".

linebreak

place holder for newline.

prettynum

Apply prettyNum to results?

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
 9
10
11
12
13
14
15
# 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 = "; "
)

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