首页 > > 详细

辅导MAST90084-Assignment 1讲解Java

MAST90084: Statistical Modelling Assignment 1
Due time: 11PM, Wednesday May 6.
DO NOT FORGET TO COMPLETE THE PLAGIARISM DECLARATION ON THE SUBJECT’S LMS
BEFORE SUBMIT YOUR FIRST ASSIGNMENT.
1. Data in the following 2× 2× 3 table were used to study the effect of passive smoking on lung cancer. The
table summarizes the results of case-control studies from 3 countries for nonsmoking women married to
smokers. (Source: Blot and Fraumeni, J. Nat. Cancer Inst., 77:993-1000 (1986) and Agresti (1996).) [15]
Country Spouse Smoked Cases Controls
Japan No 21 82
Yes 73 188
UK No 5 16
Yes 19 38
USA No 71 249
Yes 137 363
(a) A log-linear model mod1 can be fitted to the data, with the results being given in the following R
output. Give the mathematical formula (of form ln(λ) = · · ·) for model mod1. Explain why this
model is called a homogeneous association model.
> pasSmoking.dat=data.frame(freq=c(21,73,5,19,71,137,82,188,16,38,249,363))
> pasSmoking.dat$Cnt=factor(rep(c("Japan","UK", "USA"), times=2, each=2))
> pasSmoking.dat$Smo=factor(rep(c("No","Yes"), times=6))
> pasSmoking.dat$Can=factor(rep(c("Case","Control"), each=6))
> pasSmoking.dat
freq Cnt Smo Can
1 21 Japan No Case
2 73 Japan Yes Case
3 5 UK No Case
4 19 UK Yes Case
5 71 USA No Case
6 137 USA Yes Case
7 82 Japan No Control
8 188 Japan Yes Control
9 16 UK No Control
10 38 UK Yes Control
11 249 USA No Control
12 363 USA Yes Control
> mod1=glm(freq~Cnt+Smo+Can+Cnt:Smo+Cnt:Can+Smo:Can, family=poisson, data=pasSmoking.dat)
> anova(mod1, test="Chisq")
Analysis of Deviance Table; Model: poisson; Link: log; Response: freq
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev P(>|Chi|)
NULL 11 1168.85
Cnt 2 726.43 9 442.42 < 2.2e-16
Smo 1 112.52 8 329.90 < 2.2e-16
Can 1 307.56 7 22.34 < 2.2e-16
Cnt:Smo 2 15.50 5 6.84 0.0004316
Cnt:Can 2 1.05 3 5.80 0.5919109
Smo:Can 1 5.56 2 0.24 0.0184215
> 1-pchisq(0.24,2)
[1] 0.8869204
> 1-pchisq(5.80,3)
[1] 0.1217566
MAST90084 Statistical Modelling Assignment 1 Semester 1, 2020
(b) Test based on mod1 the significance of the interaction effect Smo:Can, eliminating the effects of all
other terms in the model. Comment on the implication of your result.
(c) Test the adequacy of model Cnt+Smo+Can+Cnt:Smo+Cnt:Can, at significance level 0.05, using the R
output in (a). Comment on the implication of your result and how it is related to the result of (b).
2. This question refers to the quasi-likelihood method for GLM given in the lecture notes. Show the following
results are true. [15]
(a) Based on the definition of quasi-likelihood, the quasi-score function is given by

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!