I want to know how to find and remove outliers from my Logistic Regression. I have tried using formula from Faraway, but I don't know is it applicable for logistic regression or not For example my code is
library(vcd)
library(ggplot2)
library(dplyr)
library(MLmetrics)
library(pROC)
d=read.delim("http://dnett.github.io/S510/Disease.txt")
d$disease=factor(d$disease)
d$ses=factor(d$ses)
d$sector=factor(d$sector)
finalmodel=glm(disease~age+sector, family=binomial(link=logit), data=d)
For finding the outliers I am using this code from Faraway
library(faraway)
i_n = influence(finalmodel)$hat # calculate the influence of data points with leverage
i_n
which.max(i_n)
# R code
halfnorm((i_n))
halfnorm(rstudent(finalmodel)) #jacknife residuals
Please help me if u know is it right or not. And how do I remove the outliers from my data? Thanks!