Unclear error with mice package

£可爱£侵袭症+ 提交于 2019-12-02 18:24:14

问题


I'm using the mice package to interpolate some missing values. I've successfully been using mice in many cases without any problem. However I am now facing an unprecedented problem, that is, after the first iteration I get the following error:

mice(my_data)
iter imp variable
  1   1  sunlight
Show Traceback

 Rerun with Debug
Error in cor(xobs[, keep, drop = FALSE], use = "all.obs") : 'x' is empty 

I have tried to look in the documentation but I cannot find anything useful. I looked up the error on the internet and found this https://stat.ethz.ch/pipermail/r-help/2015-December/434914.html but I was unable to find the answer to the problem described.

Sadly I cannot provide a working example of the data since my_data contains private data that I do not own and therefore cannot make publicly available. my_data is a dplyr dataframe however it looks like there's no difference in using a dplyr or a "base" dataframe.

Could anyone please explain me what is happening and (possibly) how to fix it? Thank you.

EDIT: added some more info on traceback:

cor(xobs[, keep, drop = FALSE], use = "all.obs") 
4 remove.lindep(x, y, ry, ...) 
3 sampler(p, data, m, imp, r, visitSequence, c(from, to), printFlag, 
    ...) 
2 mice::mice(my_data)

回答1:


Very possible, some columns in the data input are overly correlated that certain methods of imputation are not applicable.



来源:https://stackoverflow.com/questions/38153385/unclear-error-with-mice-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!