# Compute optimal cutoff point for logistic regression

Using R, I used logistic regression to predict a binary target variable. But using a rule like "$<50\%$ then $0$ and $\ge 50\%$ then $1$" feels arbitrary.

How can I do that with R? I mean compute a cutoff point according to my data.

• Why do you need a cutoff point? Logistic regression is risk estimation, not classification. Anyhow, if you really need a decision, then the cutoff cannot be determined from the daya,but from the costs associated withthe problem, and neednot be the samefor every case. Search this site for proper score function, cutoff, logistic regrwssion, and posts by @Frank Harrell – kjetil b halvorsen Mar 25 '17 at 21:16