我正在处理一个偏好数据集,其中要求人们对1-4中的偏好进行排名。下面是一个简单的示例:
pref1 <- c("1","2","3","4","4","3","2","1","1")
pref2 <- c("4","3","2","1","1","2","3","4","4")
pref3 <- c("2","1","4","3","2","1","4","3","2")
pref4 <- c("3","4","1","2","3","4","1","2","3")
preference<- data.frame(pref1,pref2,pref3,pref4)
preference
在我使用的数据集中,这些首选项列中有一些缺失值,在我的数据集中,它们是第61-64列,我正在尝试使用mice软件包来填充那些缺失值。运行插补时,我得到的行最终在列中具有四个相同的数字;列中三个相同的数字;或列中两个相同的数字。
我试图弄清楚如何训练(如果这是正确的措辞),推论是不允许在同一行的这些列中使用相同数字的倍数,并使其从1-4中进行选择。也许这可行吗?
谢谢