I would like to do some imputation in a situation like this:

Knowing that a value is missing is highly informative itself: if a certain variable has a missing value, it must be between zero and some positive constant c. This c is smaller (usually quite a lot smaller) than any of the observed values. Constant c varies between the variables, though. Because of this informative nature of missing values, I consider that uniformly distributed random numbers would suffice.

The problem is how to do this in the framework of mice package because 'runif imputation' is not built in mice. Even I (with my humble coding skills) could easily do the actual imputation part without the package but I would like to exploit the very convenient framework in the analyses.

I found a topic a bit similar (Multiple imputation for missing values) where some custom imputation methods are implemented but they actually refer to a method already implemented in mice (PMM), so it appears not to be very helpful.

I also tried to study the post-processing feature (https://www.gerkovink.com/miceVignettes/Passive_Post_processing/Passive_imputation_post_processing.html) but the "squeeze" example is not quite the thing I am looking for and I do not know how to modify it to my case.

So, what could be the easiest way to do this 'runif imputation' in mice package?

A toy model of the data and the corresponding constants c are below:


  • $\begingroup$ I am voting to leave this open because the underlying issue is statistical. Some might think it is a duplicate, but I don't think it is. $\endgroup$
    – Peter Flom
    Jul 18, 2019 at 11:19

1 Answer 1


Questions about R are off topic here, but the basic thing is that MICE is not designed for this sort of situation. What you have is a special type of missingness - your data are censored. That is, you know the data are between 0 and c, but you don't know exactly where.

MICE (and other general programs for multiple imputation) are designed for the general case of missing data - where the missing value could be almost anything, even a value larger than any in the data. They are also based on using existing information to do the imputation.

So, you may be right to want uniform imputation for the data (it might be better to use some other distribution, depending on the case, but it probably won't make much difference) but you are looking in the wrong place for a solution.

If you Google "censored data interval r minimum detectable" you will find some articles that I think will help.

  • $\begingroup$ That search query gives me exactly one hit: this question. $\endgroup$
    – Roland
    Jul 18, 2019 at 12:54
  • 1
    $\begingroup$ Now that is peculiar. I got over 1 million hits, the first page full of relevant stuff. Oh, did you include the quotes? I searched without them. $\endgroup$
    – Peter Flom
    Jul 18, 2019 at 19:36
  • 1
    $\begingroup$ Oh, that's it. I included the quotes. $\endgroup$
    – Roland
    Jul 19, 2019 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.