File: eiv.R

package info (click to toggle)
r-cran-gparotation 2014.11-1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 332 kB
  • sloc: sh: 13; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
eiv <- function(L,  identity=seq(NCOL(L)), ...){
   A1 <- L[ identity, , drop=FALSE]
   g <- solve(A1)
   if(1e-14 < max(abs(diag(1, length(identity)) - A1 %*% g)))
      warning("Inverse is not well conditioned. Consider setting identity to select different rows.")
   B <- array(NA, dim(L))
   B[identity, ] <- diag(1, length(identity))
   B[-identity,] <- L[-identity,, drop=FALSE] %*% g
   dimnames(B) <- list(dimnames(L)[[1]], paste("factor", seq(NCOL(L))))
   list(loadings=B, Th=t(A1), method="eiv", orthogonal=FALSE, convergence=TRUE,
        Phi= tcrossprod(A1))
   }