Question: Load Pima Indians Diabetes Data from mlbench library through the following process: library(mlbench) data(PimaIndiansDiabetes) head(PimaIndiansDiabetes) a. Fit a logistic regression model using the variable diabetes

Load Pima Indians Diabetes Data from mlbench library through the following process: library(mlbench) data(PimaIndiansDiabetes)

head(PimaIndiansDiabetes)

a. Fit a logistic regression model using the variable diabetes as the response and the other variables as the predictors. (Hint: in the formula part of the function call, you use the following statement: diabetes~pregnant+glucose+pressure+triceps+insulin+mass+pedigree+age) Summarize the model fitting results and report which variables are statistically significant.

b. What is the odds ratio for diabetes=pos between age=30 and age=40 given that all the other predictor variables are fixed at the same level?

c. Predict the probability for diabetes=pos (positive) for a new observation with the following values for the response variables: pregnant=3 glucose= 137 pressure=50 triceps=21 insulin=0 mass=23 pedigree=0.677 age=52 Hint: Create x.new object and use the following function to get the probability: predict(glm.fit,x.new,type='response')

d. Create a plot for the ROC curve. What can you say about the model performance?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!