title: Imputation with mice - exclude variable from being imputed but still use as predictor
body: <p>So I tried to impute some missing data and there is a problem. I want three variables to be used as <strong>predictors</strong> but I <em>don't</em> want them to <strong>be imputed</strong>. Even though I specified the predictormatrix as the following:</p>
  <pre><code># Initialize
  m0 = mice(datimp, maxit = 0)
  
  predmat = m0$predictorMatrix
  m0$predictorMatrix
  m0$method
  
  meth = m0$method
  meth[&quot;cm.dep.0&quot;] = &quot;2l.pan&quot;
  meth[&quot;cm.dep.1&quot;] = &quot;2l.pan&quot;
  meth[&quot;cm.dep.2&quot;] = &quot;2l.pan&quot;
  
  
  # Group is added as a fixed effect to all variables
  predmat[,&quot;trial&quot;] = -2
  predmat[,&quot;group&quot;] = 1
  predmat[&quot;sess&quot;,]= 0
  predmat[&quot;depmed&quot;,]= 0
  predmat[&quot;prevpsychoth&quot;,]= 0
  predmat
  
               trial group sex age sess degree rel child depmed prevpsychoth cm.dep.0 cm.dep.1
  trial           -2     1   1   1    1      1   1     1      1            1        1        1
  group           -2     1   1   1    1      1   1     1      1            1        1        1
  sex             -2     1   0   1    1      1   1     1      1            1        1        1
  age             -2     1   1   0    1      1   1     1      1            1        1        1
  sess             0     0   0   0    0      0   0     0      0            0        0        0
  degree          -2     1   1   1    1      0   1     1      1            1        1        1
  rel             -2     1   1   1    1      1   0     1      1            1        1        1
  child           -2     1   1   1    1      1   1     0      1            1        1        1
  depmed           0     0   0   0    0      0   0     0      0            0        0        0
  prevpsychoth     0     0   0   0    0      0   0     0      0            0        0        0
  cm.dep.0        -2     1   1   1    1      1   1     1      1            1        0        1
  cm.dep.1        -2     1   1   1    1      1   1     1      1            1        1        0
  cm.dep.2        -2     1   1   1    1      1   1     1      1            1        1        1
               cm.dep.2
  trial               1
  group               1
  sex                 1
  age                 1
  sess                0
  degree              1
  rel                 1
  child               1
  depmed              0
  prevpsychoth        0
  cm.dep.0            1
  cm.dep.1            1
  cm.dep.2            0
  </code></pre>
  <p>In the end <code>sess</code>, <code>depmed</code> and <code>prevpsychoth</code> are being imputed. Any ideas why this happens?</p>