compare_n_numvars: Comparison for columns of Gaussian measures for n groups

Description Usage Arguments Value Examples

Description

Comparison for columns of Gaussian measures for n groups

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
compare_n_numvars(
  .data = rawdata,
  dep_vars,
  indep_var,
  round_desc = 2,
  range = FALSE,
  rangesep = " ",
  pretext = FALSE,
  mark = FALSE,
  round_p = 3,
  add_n = FALSE
)

Arguments

.data

name of dataset (tibble/data.frame) to analyze, defaults to rawdata.

dep_vars

vector of column names.

indep_var

name of grouping variable.

round_desc

number of significant digits for rounding of descriptive stats.

range

include min/max?

rangesep

text between statistics and range or other elements.

pretext, mark

for function formatP.

round_p

level for rounding p-value.

add_n

add n to descriptive statistics?

Value

A list with elements "results": tibble with descriptive statistics, p-value from ANOVA, p-values for pairwise comparisons, significance indicators, and descriptives pasted with significance. "raw": nested list with output from all underlying analyses.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Usually,only the result table is relevant:
compare_n_numvars(
  .data = mtcars, dep_vars = c("wt", "mpg", "qsec"),
  indep_var = "cyl"
)$results
# For a report, result columns may be filtered as needed:
compare_n_numvars(
  .data = mtcars, dep_vars = c("wt", "mpg", "qsec"),
  indep_var = "cyl"
)$results %>%
  dplyr::select(Variable, `cyl 4 fn`:`cyl 8 fn`, pANOVA)

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