I have a question about the mice package in R for multiple imputation. It is giving me an error message that I don't understand and have not been able to find information about so far on the internet. The error only occurs when I include a categorical variable with more than 2 levels with imputation method polyreg, so I wondered if I should ask here or on stackoverflow ? Frankly I prefer to ask here if possible because people here seem a bit more friendly !

Also, I'm slightly concerned about asking because ideally I would like to make a reproducable example, but there is a lot of data, plus the code, plus the predictor matrix, and the fact that my school probably would not be happy if I posted the data they gave me for private study on the internet. I suppose I could try to modify the data in slight ways to get around the last point. Is there any guidance for making examples (including how/where to post the data) ? Is it necessary to do make a working example ? Could I just ask the question first (maybe some experts know the answer off the top of their heads) with the proviso that I will make an working example if requested (and given some guidance for doing so).

Sorry for the long posting !

  • $\begingroup$ +1 for the "people here seem a bit more friendly". However, note that many CV users also answer questions on SO. $\endgroup$ Commented Jul 6, 2012 at 16:42

1 Answer 1


It looks like there always have been some problems inherent to the use of the mice package, although this really is a good package. (Sometimes, this is just a matter of reading the doc, but sometimes not.)

I would suggest to post your question here, because multiple imputation is a statistical problem, that can be dealt with several statistical packages, including R. We can migrate it to Stack Overflow if it happens it will be better suited there. It is always difficult to choose between either sites when the question is about a statistical question that is closely linked to a particular software.

About how to make a reproducible example, I am aware of this: How to make a great R reproducible example? If you are concerned with data confidentiality, try to provide a simulated dataset that closely match yours. If this is not possible, consider giving as much information as you can, and report issues with data disclosure.

  • 1
    $\begingroup$ On the data confidentiality issue - check out this SO post for an R function that anonymizes a dataframe automatically. $\endgroup$
    – atiretoo
    Commented Jul 7, 2012 at 14:23
  • $\begingroup$ Thanks, @atiretoo. We also have had some discussion around statistical disclosure and anonynimisation. $\endgroup$
    – chl
    Commented Jul 7, 2012 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .