How to solve y must be binary error on Hmisc?

313 Views Asked by At

I am trying to extract the Concordance index of a glmer model by using somers2 of the Hmisc package in R.

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

By I get this error:

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

But, when I ask about my y:

  0   1 
655 697 

Isn't this as binary as it gets? I'm very stuck. Any help will be appreciated!!

1

There are 1 best solutions below

0
On

I found an answer guys. Just posting it here in case someone has the same issue: though binary, I had to turn it into a factor.