groupedstats (version 0.1.1)

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

Description

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

Running Wilcox test across multiple grouping variables.

Usage

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

Run this code
# NOT RUN {
# 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
)
# }

Run the code above in your browser using DataLab