【问题标题】:How to solve y must be binary error on Hmisc?如何解决 y must be binary error on Hmisc?
【发布时间】:2019-04-11 11:53:27
【问题描述】:

我正在尝试通过使用 R 中 Hmisc 包的 somers2 来提取 glmer 模型的一致性索引。

probs <- binomial()$linkinv(fitted(my.glmer.model))
somers2(probs, as.numeric(my.df$my.col)-1)

我得到这个错误:

Error in somers2(probs, as.numeric(my.df$my.col)- 1) : 
  y must be binary

但是,当我问起我的 y 时:

  0   1 
655 697 

这不是二进制的吗?我很困。任何帮助将不胜感激!

【问题讨论】:

标签: r hmisc


【解决方案1】:

我找到了答案,伙计们。只是在这里发布它以防有人遇到同样的问题:虽然是二进制的,但我不得不把它变成一个因素。

【讨论】:

    猜你喜欢
    • 2023-03-19
    • 2012-03-03
    • 1970-01-01
    • 2019-09-14
    • 1970-01-01
    • 1970-01-01
    • 2018-02-05
    • 2017-12-03
    • 1970-01-01
    相关资源
    最近更新 更多