title: Imputing values in all columns of data.frame with mice
body: <p>I am trying to impute values using a linear model using mice. My understanding of mice is that it iterates over the rows. For a column with NAs it is using all other columns as predictors, fits the model, and then samples from this model to fill up the NAs.
  Here is an example where I generate some data, and than introduce missing data using ampute.</p>
  
  <pre><code>    n &lt;- 100
      xx&lt;-data.frame(x = 1:n + rnorm(n,0,0.1), y =(1:n)*2 + rnorm(n,0,1))
      head(xx)
      res &lt;- (ampute(xx))
      head(res$amp)
  </code></pre>
  
  <p>The missing data looks like:</p>
  
  <pre><code>            x         y
     1       NA  3.887147
     2 2.157168        NA
     3 2.965164  6.639856
     4 3.848165  8.720441
     5       NA 11.167439
     6       NA 12.835415
  </code></pre>
  
  <p>Then I am trying to impute the missing data:</p>
  
  <pre><code>   mic &lt;- mice(res$amp,diagnostics = FALSE )
  </code></pre>
  
  <p>And I would expect that then there is non, but there are NA always in one of the columns.</p>
  
  <pre><code> colSums(is.na(complete(mic,1)))
  </code></pre>
  
  <p>And in which of the two it is rather random.</p>
  
  <p>By running the code above I am getting:</p>
  
  <pre><code> &gt; colSums(is.na(complete(mic,1)))
    x  y 
    0 30 
  </code></pre>
  
  <p>but also :</p>
  
  <pre><code> &gt; colSums(is.na(complete(mic,1)))
    x  y 
   33  0 
  </code></pre>