1

I'm currently trying to figure out how to impute missing values in my panel data. I'm using the mice package in R and the following code:

miceIMP <- mice(dat, m = 10, maxit = 5, print=FALSE)
miceOutput <- complete(miceIMP)

My data is panel data which has missing values in a numeric data column (-> Deal Value). The other columns are factor variables with 17 levels (year), 38 levels (countries) and 19 levels (industries). The data has approx. 16,000 lines, hence, it's a larger data set. I already tried to reduce maxit and m to 1, but that didn't seem to change anything. I also changed the imputation methods, but with e.g. "norm" the imputed values become negative -> this is my second problem, negative values don't make sense. Here is a screenshot of my data. Data Example

So my questions is:

  1. Can you tell me how I'm reducing the running time (significantly) and simultaneously ensure that the imputed values will not become negative?

Thank you for your help.

Dom Slenk
  • 29
  • 2
  • Is there anything helpful here? https://stats.stackexchange.com/questions/209811/how-to-improve-running-time-for-r-mice-data-imputation – tauft Jun 19 '22 at 09:48
  • I already tried the quickprep function but it did not work out. It still takes very long. I'm also happy for alternatives regarding the mice package. – Dom Slenk Jun 19 '22 at 10:08
  • Have a look at [Amelia](https://gking.harvard.edu/amelia). It uses a multivariate normal approximation and as such, can be quite a lot faster than MICE. They also have specific arguments to help provide better imputations in panel data with temporal trends. – DaveArmstrong Jun 19 '22 at 10:16
  • Another option to consider: `Hmisc::aregImpute`. – dipetkov Jun 19 '22 at 11:39
  • Without example data it is hard to help out. It could be slow due to any number of reasons. If quickprep is already slow, could that be the bottleneck? Because quickprep gets called every time you do not specify a custom prediction matrix. Either way, can you please provide some (fake) data to work with? See also https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – slamballais Jun 20 '22 at 05:33

0 Answers0