Stat 431 Assignment 4 solutions|100% correct
Stat 431 Assignment 4 solutions 1. [16 marks] (a) [4 marks] We start with fitting the log-linear model without a three way interaction term. This model results in a deviance test D = 26.690, p − value = P(χ 2 8 D) = 0. 0.05 So we reject the H0: the model without the three way interaction fits as well as the saturated model (which is the model with three-way interaction). This implies that the three way interaction between age, breathlessness and coughing is necessary to describe the data adequately. Hence, the saturated model is the most appropriate for characterizing the association between these three factors. Specifically, for example, there is an association between breathlessness and coughing, and the nature of that association depends on age. The R Code and Selected Output is given below. # Read in the data data-("",header=TRUE) # Make variables into factors data$af-factor(data$a) data$aft-C(data$af,treatment) data$bf-factor(data$b) data$bft-C(data$bf,treatment) data$cf-factor(data$c) data$cft-C(data$cf,treatment) # Fit the model without the three way interaction model1-glm(y~aft+bft+cft+aft*bft+aft*cft+bft*cft,family=poisson,data=data) model1$deviance [1] 26.69039 model1$ual [1] 8 1-pchisq(model1$deviance, model1$ual) [1] 0.9 (b) Using the saturated model (the one with three-way interaction) • [2 marks] Let’s determine the log odds ratio
Written for
- Institution
- American University Of Health Sciences
- Course
- STAT 431
Document information
- Uploaded on
- January 16, 2023
- Number of pages
- 13
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
stat 431 assignment 4 solutions
-
university of waterloo stat 431