STATS500 Homework 9 Solved

30.00 $

Category:

Description

Rate this product
  1. Consider Problem #6 on page 233 of Chap. 15 and the description of the dataset ’butterfat’: ’Average butterfat content (percentages) of milk for random samples of twenty cows (ten two- year old and ten mature (greater than four years old)) from each of five breeds.’ Use the butterfat data with ‘Butterfat’ as the response, ’Breed’ as the predictor, and only consider the ’Mature’ (see ’Age’) subset. Answer 6 (b), 6 (c) and 6 (d). Note: for 6 (d), after saving the results from “TukeyHSD”, you can plot these intervals as shown on pages 229-230 in the textbook.
  2. Use the pima data and the codes below to answer the questions.
         library(faraway)
         data(pima)
         pima$diastolic[pima$diastolic == 0] <- NA
         pima$glucose[pima$glucose == 0] <- NA
         pima$triceps[pima$triceps == 0] <- NA
         pima$insulin[pima$insulin == 0] <- NA
         pima$bmi[pima$bmi == 0] <- NA
         pima.dat <- pima
         pregn <- rep("common", length(pima$pregnant))
         pregn[pima.dat$pregnant>=10] <- "high"
         pima.dat$pregn <- pregn
         test.out <- glm(test~pregnant+ glucose+bmi+diabetes+pregnant:glucose,family=binomial,pima.dat)
         test2.out<-glm(test~pregn+ glucose+bmi+diabetes+pregn:glucose,family=binomial,pima.dat)
    
         summary(test.out)
         summary(test2.out)
    
    1. (a)  Provide the model that corresponds to “test.out” in the R-codes above.
    2. (b)  Suppose you are interested to learn whether a higher level of bmi would lead to a higher chance of showing signs of diabetes using the model in the problem above. What would be the H0 and Ha? Describe your test result and conclusion.
    3. (c)  In “test2.out”, we are interested at learning whether the association between glucose level and the chance of showing signs of diabetes changes with two levels of times being pregnant: common/regular and high. Comment on what you find.
  • HW9-nqvuc5.zip