The function implements the test for \(H_0: \Sigma_1 = \Sigma_2 = ... = \Sigma_q\) versus \(H_1\) at least one \(\Sigma_i\) is different.

mult_var_matrices_test(s, n, method = "box")

Arguments

s

a list with the sample covariance matrices.

n

a list with the sample sizes.

method

a character string specifying the method, "box" (default), please see the details section for other methods.

Value

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

statistic

the value of the statistic.

parameter

the degrees of freedom for the test.

p.value

the p-value for the test.

estimate

the estimated mean vectors.

method

a character string indicating the type of test performed.

Details

the "method" must be one of "box" (default), "xxx" (pronto otros metodos).

Author

Freddy Hernandez.

Examples

# Example 5.2.3 from Diaz and Morales (2015) page 200
s1 <- matrix(c(12.65, -16.45,
               -16.45, 73.04), ncol=2, nrow=2)
s2 <- matrix(c(11.44, -27.77,
               -27.77, 100.64), ncol=2, nrow=2)
s3 <- matrix(c(14.46, -31.26,
               -31.26, 101.03), ncol=2, nrow=2)
n1 <- 26
n2 <- 23
n3 <- 25
s <- list(s1, s2, s3)
n <- list(n1, n2, n3)

res <- mult_var_matrices_test(s, n, method="box")
res
#> 
#> 	Box test for homogeneity of covariances
#> 
#> data:  this test uses summarized data
#> phi = 6.6472, df = 6, p-value = 0.3547
#> alternative hypothesis: at least one covariance matrix is different 
#> 
#> 
plot(res, shade.col='tomato')


# Example 5.3.4 from Mardia (1979) page 141
s1 <- matrix(c(132.99, 75.85, 35.82,
               75.85, 47.96, 20.75,
               35.82, 20.75, 10.79), ncol=3, nrow=3)
s2 <- matrix(c(432.58, 259.87, 161.67,
               259.87, 164.57, 98.99,
               161.67, 98.99, 63.87), ncol=3, nrow=3)
n1 <- 24
n2 <- 24
s <- list(s1, s2)
n <- list(n1, n2)

res <- mult_var_matrices_test(s, n, method="box")
res
#> 
#> 	Box test for homogeneity of covariances
#> 
#> data:  this test uses summarized data
#> phi = 24.035, df = 6, p-value = 0.0005147
#> alternative hypothesis: at least one covariance matrix is different 
#> 
#> 
plot(res, from=20, to=30, shade.col='pink')