title: Custom predictor matrix for multiple imputation with mice in R does not work
body: <p>I am trying to impose a predictor matrix of my own to the mice command of the mice package in R, to control which variables are imputed and based on which variables they are imputed. However, the command does not work. 
  I have 33 variables and I build the matrix this way:</p>
  
  <pre><code>Pred_Matrix&lt;-(1-diag(1,33)) 
  
  Pred_Matrix[1, ] &lt;- 0 #so that this variable is not imputed 
  Pred_Matrix[, 1] &lt;- 0 #so that this variable does not impute
  
  Pred_Matrix[6, ] &lt;- 0 # so that this variable is not imputed 
  Pred_Matrix[, 6] &lt;- 0 # so that this variable does not impute
  
  ...
  </code></pre>
  
  <p>And I do the same to other 5 variables (setting both row and column to 0 so that they are not imputed and also not used to impute the other ones). This happens, therefore, in 7 variables in total. </p>
  
  <p>I then start the imputation with</p>
  
  <pre><code>imp_dataset&lt;-mice(MyDataset, m = 10, maxit = 10, pred=Pred_Matrix)
  </code></pre>
  
  <p>The error message I get after the imputation starts is:</p>
  
  <pre><code>iter imp variable
    1   1  Ed_level  Occ_levelError in model.frame.default(formula = formula(xy), data = xy[ry, ], weights = w[ry]) : 
    variable lengths differ (found for '(weights)')
  </code></pre>
  
  <p>Where Ed_level and Occ_level are two variables - and Occ_level is one of the seven whose row and column had been set to all 0s (maybe not chance?).</p>
  
  <p>I cannot make the example more reproducible because the dataset is huge. But all my experiments on smaller datasets work; it's because of the matrix, because if I don't use my own matrix everything works.
  I could not figure out what could possibly be wrong. Is there any other requirement a predictor matrix must comply to apart from having both dimensions equal to the number of variables, only including 0s and 1s, and having a diagonal=0? I cannot find any in the documentation of mice. Thank you in advance!</p>