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: enter image description here

   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 

1 Answer 1


I have had a similar problem in MICE, see my self-discussion here. The problem occurs because you have overfitted your model (too many parameters, variables), some variables are highly colinear or you have cases that have missings on all variables.

In my case the model was overfitted. One way to solve this issue is by adjusting the predictor matrix of MICE. You may give imp$pred where impis your mids object, to look at the predictor matrix. You can use

new.pred <- quickpred(data)

mice(..., pred=new.pred)

to automatically generate a predictor matrix based on the bivariate correlations of the variables in the data (eg Pearson, Spearman), where .10 is the default cutoff. This may solve your problem. More generally build your models wisely and do not just include all variables you may have.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.