test_u: Mann-Whitney U Test

View source: R/U_test.R

test_uR Documentation

Mann-Whitney U Test

Description

Performs the Mann-Whitney U test (Wilcoxon rank-sum test) to compare two independent groups, providing a statistical summary and graphical visualization.

Usage

test_u(
  ...,
  title = "Mann-Whitney Test",
  xlab = "Group",
  ylab = "Value",
  style = c("boxplot", "violin", "mono", "halfeye"),
  colors = NULL,
  help = FALSE,
  verbose = TRUE
)

Arguments

...

Two numeric vectors or a data frame containing exactly two numeric columns.

title

Character string specifying the plot title. Default: Mann-Whitney Test.

xlab

Character string specifying the x-axis label. Default: Group.

ylab

Character string specifying the y-axis label. Default: Value.

style

Character string specifying the plot style generated by the function. One of boxplot, violin, mono, or halfeye. Default: boxplot.

colors

Optional character vector specifying the plot colors.

help

Logical. If TRUE, displays a detailed explanation of the function. Default: FALSE.

verbose

Logical. If TRUE, prints detailed messages. Default: TRUE.

Value

An invisible list containing the following components:

summary

Group-wise descriptive statistics.

test

An object of class htest containing the Mann-Whitney U test results.

plot

A plot object generated using ggplot2.

Examples

x <- c(1, 3, 5, 6)
y <- c(7, 8, 9, 12)
data <- data.frame(groupA = x, groupB = y)
test_u(data)

autotestR documentation built on Oct. 27, 2026, 1:07 a.m.