Classification table for logistic regression in R

给你一囗甜甜゛ 提交于 2019-12-05 06:25:59

Question is a bit old, but I figure if someone is looking though the archives, this may help. This is easily done by xtabs

classDF <- data.frame(response = mydata$Y, predicted = round(fitted(mysteps),0))

xtabs(~ predicted + response, data = classDF)

which will produce a table like this:

           response
predicted   0   1
        0 339 126
        1 130 394

I think 'round' can do the job here.
table(round(theProbs))

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