Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Basel III, The Devil And Global Banking

Authors: D. Chorafas

2nd Edition

0230353770, 9780230353770

More Books

Students also viewed these Accounting questions

Question

Summarize the goal of humanistic psychotherapy.

Answered: 1 week ago