Revision 875465dbb701152a2de23d9377cbe4c2604c4ad0 authored by Gilles Raiche on 14 October 2009, 00:00:00 UTC, committed by Gabor Csardi on 14 October 2009, 00:00:00 UTC
1 parent c9833e4
principalAxis.r
"principalAxis" <-
function(R, nFactors=2, communalities="component") {
if (communalities == "component") diag(R) <- componentAxis(R)$communalities
if (communalities == "maxr") { RT <- R; diag(RT) <- 0; diag(R) <- apply(RT, 1, max)}
if (communalities == "ginv") diag(R) <- sqrt(1-1/diag(ginv(R)))
if (communalities == "multiple") {
if (all(eigen(R)$values > 0)) diag(R) <- sqrt(1-1/diag(solve(R))) # Gorsuch (1983, p. 106)
else return("Not all eigenvalues are greater than 0") # Verication of positive definiteness
}
apa <- componentAxis(R, nFactors)
return(apa)
}
Computing file changes ...