title: Classification table and ROC curve - logistic regression in R using lrm
body: <p>I want to have a classification table for logistic regression using lrm function in rms package and then plot the roc curve.I have perfomed this using glm function.Example code </p>
  
  <pre><code>train&lt;-sample(dim(data)[1],.8*dim(data)[1]) #80-20 training/test
  datatrain&lt;-data[train,]
  datatest&lt;-data[-train,]
  fit&lt;-glm(Target ~ ., data=datatrain,family=binomial()) #Target is 0/1 variable
  prob=predict(fit,type=c("response"),datatest)
  datatest$prob=prob
  library(pROC)
  ROC &lt;- roc(Target==1 ~ prob, data = datatest)
  plot(ROC)
  confusion&lt;-table(prob&gt;0.5,datatest$Target)
  errorrate&lt;-sum(diag(confusion))/sum(confusion)
  errorrate
  </code></pre>
  
  <p>How to get the confusion matrix using lrm function?</p>