1

In package mi I found that the results are different per running imputation with exactly the same options. Consider the following code:

library(mi)
data(nlsyV)
mdf = missing_data.frame(nlsyV) 
imputations = mi(mdf, n.iter = 30, n.chains = 4, seed=123)
data1 = complete(imputations, 4)
summary(data1[[4]]$ppvtr.36) #ppvtr.36 is one of the variables with missing values and now has the imputed values 

The results of the once running the code for variable ppvtr.36 is:

 Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
41.00   74.00   87.00   86.08   99.00  132.00 

If the code is run for once more, the results are:

 Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
27.96   72.89   86.50   85.58   98.86  138.60 

Obviously the results of imputation is different for each time performing it, nevertheless the seed is fixed. Is it normal?

M. Er
  • 881
  • 1
  • 7
  • 13
  • 1
    Please provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. I cannot seem to get this to work with the built in example dataset. – MrFlick Jul 07 '17 at 17:36
  • 2
    try setting parallel =FALSE, see https://stackoverflow.com/questions/38152274/make-mi-output-in-r-reproducible – user20650 Jul 07 '17 at 18:23

0 Answers0