I am solving one classification problem using logistic regression algorithm.I am currently trying to find ROC(Reciever Operator Characteristic ) curve to optimize threshold value of the model.

quality=read.csv(“quality.csv”) # load the data

require(“caTools”) # package for splitting

set.seed(88)

split= sample.split(quality$PoorCare,0.75) # 75% data for training

qualitytrain=subset(quality,split==TRUE)

qualitytest=subset(quality,split==FALSE)

QualityLog=glm(PoorCare~ OfficeVisits+Narcotics , data=qualitytrain,family=binomial) # model

predicttrain=predict(QualityLog,type=“response”) #predicting on training data