psych::principal - explanation for the order and naming of rotated (principal) components

前端 未结 2 1401
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 04:57

Let x be a sample dataframe.

set.seed(0)
x <- replicate(4, rnorm(10))

A PCA using the principal function from

2条回答
  •  长发绾君心
    2021-01-19 05:37

    Here's a partial answer. I looked through the code behind the principal function, and can see clearly where the reordering happens:

     if (nfactors > 1) {
        ev.rotated <- diag(t(loadings) %*% loadings)
        ev.order <- order(ev.rotated, decreasing = TRUE)
        loadings <- loadings[, ev.order]
      }
    

    So the code above is the reason the order changes, but it's less clear what purpose that serves. I don't have enough experience in rotations to be able to discern the package author's intent.

提交回复
热议问题