Closed GiulioCostantini closed 6 years ago
Dear Dr. Rizopoulos, I think that I found a solution: The problem arises when one column has zero variance in the simulated datasets. Function unidimTest works by replacing this part
for (b in 1:B) {
if (!missing(object))
z.vals <- rnorm(n, ablts, se.ablts)
data.new <- rmvlogis(n, parms, IRT = IRT, z.vals = z.vals)
T.boot[b, ] <- eigenRho(data.new)$ev
}
with the following code, which simply checks whether there are columns with zero variance in the simulated dataset and, in that case, simply simulates a new dataset until all columns have at least some variance.
for (b in 1:B) {
dataok <- FALSE
while(!dataok)
{
if (!missing(object))
z.vals <- rnorm(n, ablts, se.ablts)
data.new <- rmvlogis(n, parms, IRT = IRT, z.vals = z.vals)
if(all(apply(data.new, 2, sd) != 0))
dataok <- TRUE
}
T.boot[b, ] <- eigenRho(data.new)$ev
}
Kind regards
Thanks! I'll have a look rectifying this.
Hi, I know this is an old thread, but just checking in to see if this was fixed. I am running into the same error.
hi I have the same issue using the function UnidimTest. However, the written code is without comments so I couldn't make it work for my case
dear Dr. Rizopoulos, I am experiencing an issue with function unidimTest, which I could reproduce with simulated data
I get the following error
And the following three warnings, repeated many times each
Thank you for your help, Giulio