Diabet Prediction with Logistic Regression

Authors

  • Zijia Li

DOI:

https://doi.org/10.61173/htb5n992

Keywords:

Diabet Prediction, Logistic Regression Model

Abstract

Diabetes is a common chronic disease that seriously challenges countries worldwide. However, there are problems such
as low detection rate, low awareness rate, low acceptance rate, and low treatment compliance rate in the diagnosis and
treatment process. This paper aims to construct a Logistic Regression Model to predict whether a patient has diabetes
or not and to investigate the key factors that can be used to diagnose whether a patient has diabetes or not to promote
the development of diabetes treatment. The research results show that the patient’s characteristics, such as the number
of times prior, body mass index, and diagnostic measurements such as plasma glucose concentration 2 hours in an
oral glucose tolerance test, trips skin fold thickness, 2-hour serum insulin, and diabetes pedigree function will have a
significant impact on whether the patient has diabetes. Therefore, the above six variables should be focused on when
diagnosing diabetes mellitus.

References

[1] Smith J W, Everhart J E, Dickson W C, et al. Using the # process the missing value ADAP Learning Algorithm to Forecast the Onset of Diabetes diabetes$Glucose[diabetes$Glucose==0] <- NA Mellitus[J]//Proceedings of the annual symposium on computer diabetes$BloodPressure[diabetes$BloodPressure==0] <- NA application in medical care. American Medical Informatics diabetes$SkinThickness[diabetes$SkinThickness==0] <- NA Association, 1988: 261-265. diabetes$Insulin[diabetes$Insulin==0] <- NA

[2] Santhanam T, Padmavathi M S. Application of K-means and diabetes$BMI[diabetes$BMI==0] <- NA genetic algorithms for dimension reduction by integrating SVM aggr(diabetes, prop=T, numbers=T) for diabetes diagnosis[J]. Procedia Computer Science, 2015, 47: pMiss <- function(x){sum(is.na(x)) / length(x) * 100} 76-83. apply(diabetes, 2, pMiss)

[3] Hasan M K, Alam M A, Das D, et al. Diabetes Prediction Using Ensembling of Different Machine Learning Classifiers[J]. 1 Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Dean&Francis diabetes$Glucose[diabetes$Outcome==’No’] <- impute(diabetes fill=Outcome, color=Outcome)) + geom_density(alpha=0.5) + $Glucose[diabetes$Outcome==’No’], mean) ggtitle(“Density plot of Glucose”) diabetes$Glucose[diabetes$Outcome==’Yes’] <- impute(diabete p3 <- ggplot(data=diabetes, mapping=aes(x=BloodPressure, s$Glucose[diabetes$Outcome==’Yes’], mean) fill=Outcome, color=Outcome)) + geom_density(alpha=0.5) + diabetes$BloodPressure[diabetes$Outcome==’No’] <- impute(d ggtitle(“Density plot of BloodPressure”) iabetes$BloodPressure[diabetes$Outcome==’No’], mean) p4 <- ggplot(data=diabetes, mapping=aes(x=SkinThickness, diabetes$BloodPressure[diabetes$Outcome==’Yes’] <- impute(d fill=Outcome, color=Outcome)) + geom_density(alpha=0.5) + iabetes$BloodPressure[diabetes$Outcome==’Yes’], mean) ggtitle(“Density plot of SkinThickness”) diabetes$SkinThickness[diabetes$Outcome==’No’] <- impute(d p5 <- ggplot(data=diabetes, mapping=aes(x=Insulin, iabetes$SkinThickness[diabetes$Outcome==’No’], mean) fill=Outcome, color=Outcome)) + geom_density(alpha=0.5) + diabetes$SkinThickness[diabetes$Outcome==’Yes’] <- impute( ggtitle(“Density plot of Insulin”) diabetes$SkinThickness[diabetes$Outcome==’Yes’], mean) p6 <- ggplot(data=diabetes, mapping=aes(x=BMI, fill=Outcome, diabetes$Insulin[diabetes$Outcome==’No’] <- impute(diabetes$ color=Outcome)) + geom_density(alpha=0.5) + ggtitle(“Density Insulin[diabetes$Outcome==’No’], mean) plot of BMI”) diabetes$Insulin[diabetes$Outcome==’Yes’] <- impute(diabetes p7 <- ggplot(data=diabetes, mapping=aes(x=Diabete $Insulin[diabetes$Outcome==’Yes’], mean) sPedigreeFunction, fill=Outcome, color=Outcome)) diabetes$BMI[diabetes$Outcome==’No’] <- impute(diabetes$B + geom_density(alpha=0.5) + ggtitle(“Density plot of MI[diabetes$Outcome==’No’], mean) DiabetesPedigreeFunction”) diabetes$BMI[diabetes$Outcome==’Yes’] <- impute(diabetes$B p8 <- ggplot(data=diabetes, mapping=aes(x=Age, fill=Outcome, MI[diabetes$Outcome==’Yes’], mean) color=Outcome)) + geom_density(alpha=0.5) + ggtitle(“Density plot of Age”) # EDA cowplot::plot_grid(p1, p2, p3, p4, p5, p6, p7, p8, ncol = 2) ggplot(data=diabetes) + geom_bar(aes(x=””, fill=Outcome), width = 1) + coord_polar(theta=”y”) + scale_fill_ # build the logistic regression model discrete(labels=c(paste(‘No’, paste(‘(‘, round(sum(diabetes$O model <- glm(Outcome~., family=binomial(), data=diabetes) utcome==’No’) / nrow(diabetes) * 100, 1), ‘%)’, sep = ‘’), sep summary(model) = ‘’), paste(‘Yes’, paste(‘(‘, round(sum(diabetes$Outcome== predict_result <- predict(model, type = “response”) ’Yes’) / nrow(diabetes) * 100, 1), ‘%)’, sep = ‘’), sep = ‘’))) + summary(predict_result) ggtitle(“Pie plot of Outcome”) threshold_0.5 <- table(diabetes$Outcome, predict_result > 0.5) threshold_0.5 p1 <- ggplot(data=diabetes, mapping=aes(x=Pregnancies, accuracy_0.5 <- round(sum(diag(threshold_0.5))/ fill=Outcome, color=Outcome)) + geom_density(alpha=0.5) + sum(threshold_0.5), 3) ggtitle(“Density plot of Pregnancies”) sprintf(“Accuracy is %s”, accuracy_0.5) p2 <- ggplot(data=diabetes, mapping=aes(x=Glucose,

Downloads

Published

2023-08-01