test_combined: Combined test for equality of covariance matrices and...

View source: R/combined.R

test_combinedR Documentation

Combined test for equality of covariance matrices and correlation matrices

Description

For two groups a combined test for equality of covariance matrices and equality of correlation matrices between these groups is conducted. Both hypotheses can be rejected or only the larger one, the equality of the covariance matrices

Usage

test_combined(X, nv = NULL, repetitions = 1000)

Arguments

X

a list or matrix containing the observation vectors. In case of a list,each matrix in this list is another group, where the observation vectors are the columns. For a matrix, all groups are together in one matrix and nv is used to indicate the group sizes.

nv

vector of group sizes

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.

Examples

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

vars <- colnames(EEGwide)[1:6]

# Part the data into six groups of sex and diagnosis
X_list <- list(t(EEGwide[EEGwide$sex=="M" & EEGwide$diagnosis=="AD",vars]),
               t(EEGwide[EEGwide$sex=="M" & EEGwide$diagnosis=="MCI",vars]))

nv <- unlist(lapply(X_list, ncol))
set.seed(31415)
test_combined(X_list, nv)


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