prop.test: Likelihood ratio test of proportionality of several...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/prop.test.R

Description

Calculates the likelihood ratio statistic and its degrees of freedom for the hypothesis of proportional covariance matrices against the alternative of unrelated covariance matrices.

Usage

1
prop.test(covmats, nvec)

Arguments

covmats

Array of covariance matrices.

nvec

Vector of sample sizes of the k groups.

Details

This is an implementation of the algorithm described in Flury (1988).

Value

Returns a list with the following:

chi.square

The likelihood ratio test statistic.

df

Degrees of freedom of the test statistic under the null hypothesis.

covmats.prop

Estimated covariance matrices under the null hypothesis model.

Note

This test is based on the assumption that the populations from which the data originated are distributed multivariate normal.

Author(s)

Theo Pepler

References

Flury, B. (1988). Common Principal Components and Related Multivariate Models. Wiley.

See Also

flury.test, equal.test, cpc.test and cpcq.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Versicolor and virginica groups of the Iris data
data(iris)
versicolor <- iris[51:100, 1:4]
virginica <- iris[101:150, 1:4]

# Create array containing the two covariance matrices
S <- array(NA, c(4, 4, 2))
S[, , 1] <- cov(versicolor)
S[, , 2] <- cov(virginica)
nvec <- c(nrow(versicolor), nrow(virginica))

cpc::prop.test(covmats = S, nvec = nvec)

tpepler/cpc documentation built on Nov. 19, 2017, 1:19 p.m.