You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note the documentation of the package, which states the following regarding the arguments of the estQ function: n.obs: Number of individuals if r is a correlation matrix. If n.obs is provided, r will be treated as a correlation matrix. Use NULL if r is raw data. The default is NULL.
Since you are using a correlation matrix as input data for r in the function, you must specify the number of individuals. For instance, if you use n.obs = 100, it works.
In the second example, please note that matrix_var is not a correlation matrix, since it is not perfectly symmetrical. This is causing the code to think that it is not a correlation matrix, but a response matrix.
Hi Pablo,
I found the following two situations causing different errors for estQ.
(1) first
library("randcorr")
r = randcorr(20)
library("cdmTools")
out1 = estQ(
r = r,
K = 3,
n.obs = NULL,
criterion = "loaddiff",
boot = TRUE,
efa.args = list(cor = "tet", rotation = "oblimin", fm = "uls"),
boot.args = list(N = 0.8, R = 100, verbose = FALSE, seed = 1)
)
Error in
colnames<-
(*tmp*
, value = paste0("Cat", 1:maxK)) :attempt to set 'colnames' on an object with less than two dimensions
(1) second
values <- c(
1.00000000, 0.2605664, 0.1858627, 0.1399712, 0.09735522,
0.26056643, 1.0000000, 0.1443643, 0.1962672, 0.20538981,
0.18586268, 0.1443643, 1.0000000, 0.1765424, 0.23795236,
0.13997122, 0.1962672, 0.1765424, 1.0000000, 0.17226901,
0.09735522, 0.2053898, 0.2379524, 0.1722690, 1.00000000
)
matrix_var <- matrix(values, nrow = 5, byrow = TRUE)
out1 = estQ(
r = matrix_var,
K = 3,
n.obs = NULL,
criterion = "loaddiff",
boot = TRUE,
efa.args = list(cor = "tet", rotation = "oblimin", fm = "uls"),
boot.args = list(N = 0.8, R = 100, verbose = FALSE, seed = 1)
)
Error in polychoric2(dat = dat, cor.smooth = cor.smooth, maxiter = maxit) :
Minimum value must always zero.
Thanks a lot for this useful package!
Chen-Wei
The text was updated successfully, but these errors were encountered: