grouped_wilcox: Function to run two-sample Wilcoxon tests on multiple...

Description Usage Arguments Value See Also Examples

View source: R/grouped_wilcox.R

Description

Function to run two-sample Wilcoxon tests on multiple variables across multiple grouping variables.

Running Wilcox test across multiple grouping variables.

Usage

1
2
3
4
5
6
7
8
grouped_wilcox(
  data,
  dep.vars,
  indep.vars,
  grouping.vars,
  paired = FALSE,
  correct = TRUE
)

Arguments

data

Dataframe from which variables are to be taken.

dep.vars

List dependent variables for a two-sample Wilcoxon tests (y in y ~ x).

indep.vars

List independent variables for a two-sample Wilcoxon tests (x in y ~ x).

grouping.vars

List of grouping variables (if NULL, the entire dataframe will be used).

paired

A logical indicating whether you want a paired two-sample Wilcoxon tests (Default: paired = FALSE).

correct

A logical indicating whether to apply continuity correction in the normal approximation for the p-value (Default: correct = TRUE).

Value

A tibble dataframe with tidy results from two-sample Wilcoxon tests analyses.

See Also

grouped_tidy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# for reproducibility
set.seed(123)

# only with one grouping variable
groupedstats::grouped_wilcox(
  data = dplyr::filter(.data = ggplot2::diamonds, color == "E" | color == "J"),
  dep.vars = depth:table,
  indep.vars = color,
  grouping.vars = clarity,
  paired = FALSE
)

IndrajeetPatil/groupedstats documentation built on June 6, 2020, 9:57 a.m.