I am having a problem using the 2l.norm
method of multilevel imputation in mice
.
Unfortunately I cannot post a reproducible example because of the size of my data - when I reduce the size, the problem vanishes.
For a particular variable, mice
produces the following errors and warnings:
Error in chol.default(inv.sigma2[class] * X.SS[[class]] + inv.psi) :
the leading minor of order 1 is not positive definite
In addition: Warning messages:
1: In rgamma(n.class, n.g/2 + 1/(2 * theta), scale = 2 * theta/(ss * :
NAs produced
2: In rgamma(1, n.class/(2 * theta) + 1, scale = 2 * theta * H/n.class) :
NAs produced
3: In rgamma(1, n.class/2 - 1, scale = 2/(n.class * (sigma2.0/H - log(sigma2.0) + :
NAs produced
If I use the 2l.pan
, norm
or pmm
methods, the problem does not occur.
The variable has the following distribution:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
50.0 117.0 136.0 136.7 155.0 249.0 3124
Also, the class sizes have the following distribution:
Min. 1st Qu. Median Mean 3rd Qu. Max.
3.00 50.00 80.00 88.52 111.00 350.00