library(MASS) model1 <- glm(type~.,family=binomial(link="logit"),data=Pima.tr) proba.logit <- predict(model1,Pima.te,type="response") classif.logit <- proba.logit>=1/2 classif.logit[classif.logit==TRUE] <- "Yes" classif.logit[classif.logit==FALSE] <- "No" mean(classif.logit!=Pima.te$type) model2 <- glm(type~.,family=binomial(link="probit"),data=Pima.tr) proba.probit <- predict(model2,Pima.te,type="response") classif.probit <- proba.probit >=1/2 classif.probit[classif.probit==TRUE] <- "Yes" classif.probit[classif.probit==FALSE] <- "No" mean(classif.probit!=Pima.te$type) curve(plogis,-10,10) curve(pnorm,-10,10,col="red",add=TRUE)