Closed jessekps closed 4 years ago
Thanks, this was definitely not intended. I've patched this so that passing pv = fscores(est,'plausible')
will return a matrix of values for MG models, whereas pv = fscores(est,plausible.draws=2)
will still return a list of matrices.
Hi,
I have an object of type 'multipleGroup', created like so:
est = multipleGroup(data = dat, itemtype = '2PL', model = 1, group = attr(dat, "booklet_id"), invariance = c("free_means", "free_var", "slopes", "intercepts"), pars = m)
I want 1 plausible value for each student, which I try to get like this:
pv = fscores(est,'plausible')
This fails with error message:
Error in matrix(NA, nrow(est@Data$data), ncol(ret[[1L]][[1L]])) : non-numeric matrix extent
As far as I can tell this is because in fscores.internal.R around line 590
the call
fscores(tmp_obj,...
returns a matrix instead of a list when plausible.draws < 2 or when method='plausible' and a few lines further, thiscolnames(out) <- colnames(ret[[1L]][[1L]])
retuires the elements of ret to be lists.
So this works:
pv = fscores(est,plausible.draws=2)
and my problem is solved but I thought you might like to know nonetheless.