#fa <- factanal(x,4,covmat=Harman74.cor$cov)
#pc <- principal(Harman74.cor$cov,4)
#pcv <- varimax(pc$loading)
#round(factor.congruence(fa,pcv),2)
#
#round(factor.congruence(pcv,fa),2)
# Factor1 Factor2 Factor3 Factor4
#PC1 1.00 0.60 0.45 0.55
#PC2 0.44 0.49 1.00 0.56
#PC3 0.54 0.99 0.44 0.55
#PC4 0.47 0.52 0.48 0.99
#compare with
#round(cor(fa$loading,pcv$loading),2)
## The function is currently defined as
#function (x,y,loading=TRUE) {
# if (loading) {x <- x$loadings
# y <- y$loadings }
# nx<- dim(x)[2]
# ny<- dim(y)[2]
# cross<- t(y) \%*\% x #inner product will have dim of ny * nx
# sumsx<- sqrt(1/diag(t(x) \%*\%x))
# sumsy<- sqrt(1/diag(t(y) \%*\%y))
# result<- matrix(rep(0,nx*ny),ncol=nx)
# result<- sumsy * (cross * rep(sumsx, each = ny))
# return(t(result))
# }
Run the code above in your browser using DataLab