I've been trying to compare the results of different computation methods for factor scoring of 2-parameter IRT model and Multiple Imputation failed. When I used the example from the documentation it also resulted in the following error:
> fit <- ltm(Abortion ~ z1)
> factor.scores(fit, method = "MI", B = 20) # Multiple Imputation
Error in FUN(X[[i]], ...) : 'dimnames' must be a list
The issue seems to be with the lines 58-59 in fscores.l.R
Instead of:
scores.B <- lapply(1:B, array, data = 0, dim = c(nx, factors))
hes.B <- lapply(1:B, array, data = 0, dim = c(factors, factors, nx))
I think it should be something like:
scores.B <- lapply(1:B, function(x) x <- array(data = 0, dim = c(nx, factors)))
hes.B <- lapply(1:B, function(x) x <- array(data = 0, dim = c(factors, factors, nx)))
I've been trying to compare the results of different computation methods for factor scoring of 2-parameter IRT model and Multiple Imputation failed. When I used the example from the documentation it also resulted in the following error:
The issue seems to be with the lines 58-59 in
fscores.l.R
Instead of:
I think it should be something like:
The same issue applies to line 72