Learn R Programming

Domean (version 0.1)

SKK: High-Dimensional Two-Sample Mean Test

Description

Conducts a high-dimensional two-sample mean test using a modified Hotelling's T-squared statistic. This test is suitable for cases where the number of variables \( p \) is larger than the sample size \( n \).

Usage

SKK(X, Y)

Value

A list containing:

TSvalue

The test statistic value.

pvalue

The p-value of the test.

Arguments

X

Matrix representing the first sample (rows are observations, columns are variables).

Y

Matrix representing the second sample (rows are observations, columns are variables).

Details

This function implements a high-dimensional two-sample mean test by adjusting the Hotelling's T-squared statistic. It uses diagonal matrices and a correction factor to handle high-dimensional data.

Examples

Run this code
# Example usage:
set.seed(123)
X <- matrix(rnorm(200), nrow = 10, ncol = 20)  # 10 samples, 20 variables
Y <- matrix(rnorm(200, mean = 0.5), nrow = 10, ncol = 20)  # Different mean
result <- SKK(X, Y)
print(result)
# Output:
# TSvalue: The test statistic value
# pvalue: The p-value indicating the significance of the test

Run the code above in your browser using DataLab