permu_test_SD: Permutation test using SD

View source: R/permu_test_SD.R

permu_test_SDR Documentation

Permutation test using SD

Description

Permutation test using SD

Usage

permu_test_SD(x, x_sd, y, y_sd, alternative = "two.sided")

Arguments

x

numeric vector of data values.

x_sd

numeric vector with standard deviations.

y

numeric vector of data values.

y_sd

numeric vector with standard deviations.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

Details

This function is based in the Python function proposed by Ermolinskiy (2024).

Value

A list with class "htest" containing the following components:

statistic

the value of the statistic.

p.value

the p-value for the test.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating the type of test performed.

Author(s)

Freddy Hernandez, fhernanb@unal.edu.co

This function performs test for dependent data in samples with a small number of subjects.

References

Ermolinskiy, P. (2024). An Extension of the Permutation Test for Dependent Data in Samples with a Small Number of Subjects. https://hal.science/hal-04558513/

Examples

# Example 0
x <- c(5, 6)
x_sd <- c(1, 2)
y <- c(7, 9)
y_sd <- c(1, 2)

res <- permu_test_SD(x, x_sd, y, y_sd, alternative="less")
res

# Example 1 of Ermolinskiy (2024).
x <- c(20, 33, 20, 24)
x_sd <- c(2, 2, 2, 2)
y <- c(21, 34, 22, 25)
y_sd <- c(2, 2, 2, 2)

res <- permu_test_SD(x, x_sd, y, y_sd, alternative="less")
res


fhernanb/stests documentation built on July 4, 2025, 1:15 p.m.