test.tpaired: Paired t-test with advanced visualizations

View source: R/Paired_T_test.R

test.tpairedR Documentation

Paired t-test with advanced visualizations

Description

Performs a paired t-test between two numeric vectors (e.g., before vs after) or between two numeric columns of a data frame. Includes four visualization styles (boxplot, violin, mono, and half-eye).

Usage

test.tpaired(
  ...,
  title = "Paired t-test",
  xlab = "",
  ylab = "Value",
  style = c("boxplot", "violin", "mono", "halfeye"),
  connect = TRUE,
  help = FALSE,
  verbose = TRUE
)

Arguments

...

Two numeric vectors of equal length, or a data frame with exactly two numeric columns.

title

Plot title.

xlab

X-axis label.

ylab

Y-axis label.

style

Plot style:

  • 1 Premium boxplot

  • 2 Violin + minimal boxplot

  • 3 mono

  • 4 Half-eye (ggdist)

connect

Logical. If TRUE, connects paired observations.

help

If TRUE, displays detailed help.

verbose

If TRUE, prints progress messages.

Value

An invisible list containing:

summary_table

Group means and standard deviations

test_result

t-test result object (stats::t.test)

data

Data frame used for plotting

plot

ggplot2 object

Examples

before <- c(13, 12, 15, 14)
after  <- c(9, 11, 10, 10)
test.tpaired(before, after)


autotestR documentation built on April 29, 2026, 1:09 a.m.