test_correlation_structure: Test for structure of data's correlation matrix

View source: R/correlation.R

test_correlation_structureR Documentation

Test for structure of data's correlation matrix

Description

With this function the correlation matrix of data can be checked for one of the predefined structures. Depending on the chosen method a bootstrap, the Taylor-based Monte-Carlo approach or Monte-Carlo-technique is used to calculate the p-value of the Anova-type-statistic(ATS) based on a specified number of runs.

Usage

test_correlation_structure(X, structure, method = "BT", repetitions = 1000)

Arguments

X

a matrix containing the observation vectors as columns (one group)

structure

a character specifying the structure regarding them the correlation matrix should be checked. Options are "Hautoregressive" ("Har"), "diagonal" ("diag"), "Hcompoundsymmetry" ("Hcs") and "Htoeplitz" ("Hteop").

method

a character, to chose whether bootstrap("BT") or Taylor-based Monte-Carlo-approach("TAY") or Monte-Carlo-technique("MC") is used, while bootstrap is the predefined method.

repetitions

a scalar, indicate the number of runs for the chosen method. The predefined value is 1,000, and the number should not be below 500.

Value

an object of the class CovTest

References

Sattler, P. and Dobler, D. (2025). Testing for patterns and structures in covariance and correlation matrices. arXiv preprint https://arxiv.org/abs/2310.11799

Examples

# Load the data
data("EEGwide", package = "MANOVA.RM")

# Select only the males with the diagnosis AD
X <- as.matrix(EEGwide[EEGwide$sex == "W" & EEGwide$diagnosis == "AD",
             c("brainrate_temporal", "brainrate_frontal","brainrate_central",
             "complexity_temporal","complexity_frontal",
             "complexity_central")])

test_correlation_structure(X = X, structure = "diagonal", method = "MC")


CovCorTest documentation built on June 8, 2025, 11:50 a.m.