r.mat<- Harman74.cor$cov
iq.clus <- ICLUST(r.mat,nclusters =2)
fit <- cluster.fit(r.mat,iq.clus$loadings,iq.clus$clusters)
fit
## The function is currently defined as
function (original, load, clusters, diagonal = FALSE, digits = 2)
{
sqoriginal <- original * original
totaloriginal <- sum(sqoriginal) - diagonal * sum(diag(sqoriginal))
model <- load %*% t(load)
residual <- original - model
sqresid <- residual * residual
totalresid <- sum(sqresid) - diagonal * sum(diag(sqresid))
fit <- 1 - totalresid/totaloriginal
model.1 <- (load * clusters) %*% t(load * clusters)
residual <- original - model.1
sqresid <- residual * residual
totalresid <- sum(sqresid) - diagonal * sum(diag(sqresid))
fit.1 <- 1 - totalresid/totaloriginal
cluster.fit <- list(clusterfit = round(fit.1, digits), factorfit = round(fit,
digits))
}
Run the code above in your browser using DataLab