In today’s blog, I have improved my code and successfully fixed all problems with earlier iterations in the analysis. I had previously created a model for linear regression. However, I thoroughly assessed this model in the current investigation using three different scenarios that involved the computation of important statistical metrics.
Later on, I studied the code for the logistic regression technique. It is a statistical method for modelling the relationship between a binary dependent variable and one or more independent variables that is used in data analysis. This particular kind of regression analysis works well when the dependent variable is categorical and has two alternative outcomes, which are frequently coded as 0 and 1 (or “yes” and “no,” “success” and “failure,” etc.).
For the implementation of logistic regression in my analysis I have considered %Diabetic as dependent variable and %Obesity and %Inactivity as independent variable. I am attempting to forecast some data from one of the datasets using logistic regression. The formula for logistic regression is: logit(p)=ln(1−pp)=β0+β1X1+β2X2+…+βkXk, where a and b are regression coefficients from the actual data plot, x is one of the predictors, and y is the calculated value. Using the code, I was able to obtain the two regression coefficients.