if (FALSE) { # require("parameters") && require("psych")
# data generation from '?prcomp', slightly modified
C <- chol(S <- toeplitz(0.9^(0:15)))
set.seed(17)
X <- matrix(rnorm(1600), 100, 16)
Z <- X %*% C
pca <- parameters::principal_components(
as.data.frame(Z),
rotation = "varimax",
n = 3
)
pca
check_itemscale(pca)
# as data frame
check_itemscale(
as.data.frame(Z),
factor_index = parameters::closest_component(pca)
)
}
Run the code above in your browser using DataLab