Revision b6fe861fe48f12c1b45d1e68f8508ee6503821ac authored by Gilles Raiche on 24 April 2007, 00:00 UTC, committed by Gabor Csardi on 24 April 2007, 00:00 UTC
1 parent 4e9967d
Raw File
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 == "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 grater than 0") # Verication of positive definiteness
  }
 apa <- componentAxis(R, nFactors)
 return(apa)
 }

back to top