eigen.test {vcvComp} | R Documentation |
Difference test for successive relative eigenvalues
Description
Tests the difference between two successive relative eigenvalues
Usage
eigen.test(n, relValues)
Arguments
n |
the sample size(s), given as a number or a vector of length 2 |
relValues |
a vector of relative eigenvalues |
Value
The P-values for the test of difference between successive eigenvalues
References
Mardia KV, Kent JT, Bibby JM (1979) Multivariate analysis. Academic Press, London.
See Also
relative.eigen
for the computation of relative eigenvalues,
pchisq
for Chi-squared distribution
Examples
# Data matrix of 2D landmark coordinates
data("Tropheus.IK.coord")
coords <- which(names(Tropheus.IK.coord) == "X1"):which(names(Tropheus.IK.coord) == "Y19")
proc.coord <- as.matrix(Tropheus.IK.coord[coords])
# Data reduction
phen.pca <- prcomp(proc.coord, rank. = 5, tol = sqrt(.Machine$double.eps))
pc.scores <- phen.pca$x
# Covariance matrix of each population
S.phen.pop <- cov.group(pc.scores, groups = Tropheus.IK.coord$POP.ID)
# Relative PCA = relative eigenanalysis between 2 covariance matrices
# (population IKA1 relative to IKS5)
relEigen.a1s5 <- relative.eigen(S.phen.pop[, , "IKA1"], S.phen.pop[, , "IKS5"])
# Test of the difference between 2 successives eigenvalues
# of the covariance matrix of IKA1 relative to IKS5
n_ika1 <- length(which(Tropheus.IK.coord$POP.ID == "IKA1")) # sample size for IKA1
n_iks5 <- length(which(Tropheus.IK.coord$POP.ID == "IKS5")) # sample size for IKS5
eigen.test(n = c(n_ika1, n_iks5), relValues = relEigen.a1s5$relValues)
[Package vcvComp version 1.0.2 Index]