0
$\begingroup$

I would like to perform a parallely analysis based on polychoric correlations and create a polychoric correlation matrix for factor analysis. However, I get the following error every time, no matter if I insert a data frame or a matrix.

Error in cor(x, use = "pairwise") : supply both 'x' and 'y' or a matrix-like 'x'

data_s <- subset(Items, select= c(A_RSA_01, A_RSA_02, A_RXA_01, A_RSA_03, A_RSA_04, A_RSA_05, A_RHP_01, A_RXA_02, A_RXA03r, C_RSA_02, C_RSA_04, C_RXA_01, C_RSA_07, C_VXA_01, V_VHA_01, V_VHP_01, V_RHP_01, V_VXP01, V_RHP_02, V_RHP03, V_VHP_02, V_RHA_01, V_RSA01, V_RSA_02, V_RHA_02, V_RSA_03, V_RXA_01, V_RSA_04, V_RSA05, V_RHA_03, I_RXP_01, I_RXA_01, I_RXA_02, I_RSA_01, I_RXP_02, I_XXA_01, I_RXA_03, I_RXA04, I_RSA_02, I_RHA_01, S_RHA_01, S_RHA02, S_RHP_01, S_RHP_02, S_RHA_03, S_RSP_01, S_RSP02, S_RHA_04, S_RXX_01, S_RHP03, S_RSP_03, S_RXA_01, S_RSP_04, S_RSA01, S_RSP_05, S_RSA_02, S_RSA_03, S_RXX_02, S_VHA01, S_VHP_01, S_VHP02, S_VHP_03, S_VSA01, S_VSP_01, S_VSP_02, S_VSA_02, S_VSA_03, S_VSA_04, S_XSP_01))
data <- as.matrix(data_s)
is.matrix(data)
psych::polychoric(data)

this results in: Error in cor(x, use = "pairwise") : supply both 'x' and 'y' or a matrix-like 'x'

nfactors (data, rotate = "promax", fm = "pa",cor = "poly")

this too results in: Error in cor(x, use = "pairwise") : supply both 'x' and 'y' or a matrix-like 'x'

I'd be very happy if someone can help. Thanks!

New contributor
Lonii is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$

0

Browse other questions tagged or ask your own question.