Last chance! 50% off unlimited learning
Sale ends in
cortest.normal(R1, R2 = NULL, n1 = NULL, n2 = NULL, fisher = TRUE) #the steiger test
cortest(R1,R2=NULL,n1=NULL,n2 = NULL, fisher = TRUE,cor=TRUE) #same as cortest.normal
cortest.jennrich(R1,R2,n1=NULL, n2=NULL) #the Jennrich test
cortest.mat(R1,R2=NULL,n1=NULL,n2 = NULL) #an alternative test
cortest
and cortest.normal
Yet another test, is the Jennrich(1970) test of the equality of two matrices. This compares the differences between two matrices to the averages of two matrices using a chi square test. This is implemented in cortest.jennrich
.
Yet another option cortest.mat
is to compare the two matrices using an approach analogous to that used in evaluating the adequacy of a factor model. In factor analysis, the maximum likelihood fit statistic is
$f = log(trace ((FF'+U2)^{-1} R) - log(|(FF'+U2)^-1 R|) - n.items$.
This in turn is converted to a chi square
$chi^2 = (n.obs - 1 - (2 * p + 5)/6 - (2 * factors)/3)) * f $ (see fa
.)
That is, the model (M = FF' + U2) is compared to the original correlation matrix (R) by a function of $M^{-1} R$. By analogy, in the case of two matrices, A and B, cortest.mat
finds the chi squares associated with $A^{-1}B$ and $A B^{-1}$. The sum of these two $\chi^2$ will also be a $\chi^2$ but with twice the degrees of freedom.
Jennrich, Robert I. (1970) An Asymptotic $\chi^2$ Test for the Equality of Two Correlation Matrices. Journal of the American Statistical Association, 65, 904-912.
cortest.bartlett
x <- matrix(rnorm(1000),ncol=10)
cortest.normal(x) #just test if this matrix is an identity
x <- sim.congeneric(loads =c(.9,.8,.7,.6,.5),N=1000,short=FALSE)
y <- sim.congeneric(loads =c(.9,.8,.7,.6,.5),N=1000,short=FALSE)
cortest.normal(x$r,y$r,n1=1000,n2=1000) #The Steiger test
cortest.jennrich(x$r,y$r,n1=100,n2=1000) # The Jennrich test
cortest.mat(x$r,y$r,n1=1000,n2=1000) #twice the degrees of freedom as the Jennrich
Run the code above in your browser using DataLab