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
rRecovery.r
"rRecovery" <-
function(R, loadings, communalities=FALSE) {
 recoveredR <- loadings %*% t(loadings)
 recovery   <- list(R = R, recoveredR = recoveredR, difference = R - recoveredR)
 if (communalities == FALSE) {diag(R)    <- NA; diag(recoveredR) <- NA }
 corr       <- cor(c(R),c(recoveredR), use="pairwise.complete.obs")
 recovery   <- list(recovery, cor = corr)
 return(recovery)
 }

 
back to top