Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STAT 426 – Categorical Data Analysis

Homework 7

2022

Please submit your HW in output file  of R  Markdown.  Your output file should include all the R codes.

1.  Return to the pima dataset in the faraway package.  Use logistic regression to fit model 1 using test as the response and bmi and age as the predictors.  Also, fit model 2 using bmi, age, triceps, and pregnant as the predictors.  Before fitting them remove all cases in which either bmi or triceps takes the value 0.  Examine the regression coefficients of model 2 and comment on how each predictor appears to affect the chance of developing diabetes.

 

2.  Do the following using model 2.

 

(i) In a 2 by 2 grid of plots, plot the fitted values  versus each of the predictors separately. (ii)  Plot the leverages of all the cases (hatvalues).

(iii) Find the case with the highest leverage and examine her data. Do you believe all of the values? Explain.

 

3. Find the pvalue of the likelihood ratio test for testing the restricted model that only bmi and age are needed versus the alternative hypothesis that all 4 predictors are needed.

 

4. Using model 2, study the predict() function and use it to predict the chance a Pima woman will develop diabetes if she has been pregnant 10 times, has a body mass index of 40, is 50 years old and has a triceps skin fold thickness of 40 mm.  Use predict to find the standard error of this estimate.

 

5.  Consider all ways of adding a single additional predictor to model 2.  Which one results in the smallest p-value of the Wald test for the significance of its regression coefficient?  What is the p-value and how would you interpret the effect of this predictor has on the chance of developing diabetes?