留学生作业代写 MATH 523: Generalized Linear Models February 25, 2020

Instructions
Midterm Exam VERSION A
MATH 523: Generalized Linear Models February 25, 2020
• This is a closed book exam.

Copyright By PowCoder代写 加微信 powcoder

• Answer both questions in the examination booklets provided. • Calculators and translation dictionaries are permitted.
• R output and statistical tables are provided.
Good Luck!

Problem 1. Consider the Geometric family of distributions with parameter π P p0, 1q and probability mass function
fpy;πq“πyp1 ́πq, yPt0,1,…u.
(a) [4 marks] Show that the Geometric family is an exponential dispersion family. Identify the functions bp ̈q and cp ̈q, as well as the dispersion and canonical parameters.
(b) [3 marks] Compute the mean and variance of the Geometric distribution and identify the mean-variance relationship.
(c) [2 marks] Identify the canonical link for a Geometric GLM. Comment on its suitability.
(d) [2 marks] What other link functions might be suitable and why?
(e) [1 mark] For what kind of data would a Geometric GLM be better suited than a
Poisson GLM (Hint: look at the mean-variance relationship)?
(f) [4 marks] Derive the likelihood (score) equations for the Geometric GLM when the log link is used. Explain how the equations simplify when the canonical link is used.
(g) [4 marks] Calculate the Fisher Information Matrix for the Geometric GLM when the log link is used.

Problem 2. Consider the following data on ear infections in swimmers from the 1990 Pilot Surf/Health Study of the Wales Water Board.
NumInfec the number of self-diagnosed ear infections
Age the age of the swimmer (with levels 15-19, 20-24 and 25-29);
Sex gender of the swimmer (with levels Female and Male);
Loc the usual swimming location (with levels Beach and NonBeach)
Swim frequency of swims in the ocean (with levels Freq(ently) and Occas(ionally))
(a) [5marks]ThedatawerefirstmodeledwithaGLMmodelm1whoseoutputisgiven on page 4, lines 1–23. From this output:
– Identify the response and the predictors;
– Identify the GLM that was used and the link function;
– Identify the sample size n;
– For each main effect, write down whether it is treated as a factor or a covariate (continuous predictor).
(b) [3 marks] In model m1, quantify the effect of Age and Loc on the response.
(c) [3 marks] Fill in the values marked by XXX on line 12. Does the p-value allow you
to conclude that Age is not a significant predictor? Explain.
(d) [4 marks] What is the estimated mean number of self-diagnosed ear infections of a
swimmer aged 22 who prefers to swim far from the beach?
(e) [5 marks] A simpler model m2 whose output is given on lines 26–46 has been fitted to the data. Test whether m2 is an adequate simplification of m1 at the 5% significance level. Interpret the finding in terms of significance of Age and Loc.
Use the R output on page 4, and the χ2ν table on page 5.

2 3 4 5 6 7 8 9
glm(formula = NumInfec ̃ Age + Loc, family = poisson)
Deviance Residuals :
Min 1Q Median
́1.9905 ́1.5449 ́1.2971
3Q Max 0.6723 7.3326
Coefficients : Estimate
Pr(>|z |) 0.05972 0.00484
XXXX 1.17e ́06
poisson family taken to be 1)
on 286 degrees of freedom on 283 degrees of freedom
Std . 0.09387
0.12411 0.12982 0.10430
z value 1.883 ́2.817
XXXX 4.860
(Intercept) Age20 ́24 Age25 ́29 LocNonBeach
0.17675 ́0.34968 ́0.17896
0.50692 Signif. codes: 0 ’∗∗∗’
(Dispersion parameter for
Null deviance : 824.51 Residual deviance : 791.77 AIC: 1172.2
Number of Fisher Scoring iterations : 6
glm(formula = NumInfec ̃ Loc, family = poisson)
0.001 ’∗∗’ 0.01
’.’ 0.1 ’ ’ 1
Deviance Residuals :
Min 1Q Median
́1.8632 ́1.4522 ́1.4522
Coefficients :
Estimate Std .
0.660 0.509 LocNonBeach 0.49843 0.10280 4.849 1.24e ́06 ∗∗∗
Signif. codes: 0 ’∗∗∗’ 0.001 ’∗∗’ 0.01 ’∗’ 0.05 ’.’ 0.1 ’ ’ 1 (Dispersion parameter for poisson family taken to be 1)
Null deviance: 824.51 on 286 degrees of freedom Residual deviance : 800.36 on 285 degrees of freedom AIC: 1176.8
Number of Fisher Scoring iterations : 6
Error z ( Intercept ) 0.05299 0.08032
Max 6.8595
value Pr(>|z |)

ν 0.99500 0.99000
1 0.00004 0.00016
2 0.01003 0.02010
3 0.07172 0.11483
4 0.20699 0.29711
5 0.41174 0.55430
6 0.67573 0.87209
7 0.98926 1.23904
8 1.34441 1.64650
9 1.73493 2.08790
10 2.15586 2.55821
11 2.60322 3.05348
12 3.07382 3.57057
13 3.56503 4.10692
14 4.07467 4.66043
15 4.60092 5.22935
16 5.14221 5.81221
17 5.69722 6.40776
18 6.26480 7.01491
19 6.84397 7.63273
20 7.43384 8.26040
21 8.03365 8.89720
22 8.64272 9.54249
23 9.26042 10.19572
24 9.88623 10.85636
25 10.51965 11.52398
26 11.16024 12.19815
27 11.80759 12.87850
28 12.46134 13.56471
29 13.12115 14.25645
30 13.78672 14.95346
31 14.45777 15.65546
32 15.13403 16.36222
33 15.81527 17.07351
34 16.50127 17.78915
35 17.19182 18.50893
36 17.88673 19.23268
37 18.58581 19.96023
38 19.28891 20.69144
39 19.99587 21.42616
40 20.70654 22.16426
50 27.99075 29.70668
0.97500 0.00098 0.05064 0.21580 0.48442 0.83121 1.23734 1.68987 2.17973 2.70039 3.24697 3.81575 4.40379 5.00875 5.62873 6.26214 6.90766 7.56419 8.23075 8.90652 9.59078
10.28290 10.98232 11.68855 12.40115 13.11972 13.84390 14.57338 15.30786 16.04707 16.79077 17.53874 18.29076 19.04666 19.80625 20.56938 21.33588 22.10563 22.87848 23.65432 24.43304 32.35736
0.90000 0.01579 0.21072 0.58437 1.06362 1.61031 2.20413 2.83311 3.48954 4.16816 4.86518 5.57778 6.30380 7.04150 7.78953 8.54676 9.31224
10.08519 10.86494 11.65091 12.44261 13.23960 14.04149 14.84796 15.65868 16.47341 17.29188 18.11390 18.93924 19.76774 20.59923 21.43356 22.27059 23.11020 23.95225 24.79665 25.64330 26.49209 27.34295 28.19579 29.05052 37.68865
0.10000 2.70554 4.60517 6.25139 7.77944 9.23636
10.64464 12.01704 13.36157 14.68366 15.98718 17.27501 18.54935 19.81193 21.06414 22.30713 23.54183 24.76904 25.98942 27.20357 28.41198 29.61509 30.81328 32.00690 33.19624 34.38159 35.56317 36.74122 37.91592 39.08747 40.25602 41.42174 42.58475 43.74518 44.90316 46.05879 47.21217 48.36341 49.51258 50.65977 51.80506 63.16712
0.05000 3.84146 5.99146 7.81473 9.48773
11.07050 12.59159 14.06714 15.50731 16.91898 18.30704 19.67514 21.02607 22.36203 23.68479 24.99579 26.29623 27.58711 28.86930 30.14353 31.41043 32.67057 33.92444 35.17246 36.41503 37.65248 38.88514 40.11327 41.33714 42.55697 43.77297 44.98534 46.19426 47.39988 48.60237 49.80185 50.99846 52.19232 53.38354 54.57223 55.75848 67.50481
Right-tail
0.02500 5.02389 7.37776 9.34840
11.14329 12.83250 14.44938 16.01276 17.53455 19.02277 20.48318 21.92005 23.33666 24.73560 26.11895 27.48839 28.84535 30.19101 31.52638 32.85233 34.16961 35.47888 36.78071 38.07563 39.36408 40.64647 41.92317 43.19451 44.46079 45.72229 46.97924 48.23189 49.48044 50.72508 51.96600 53.20335 54.43729 55.66797 56.89552 58.12006 59.34171 71.42020
0.01000 6.63490 9.21034
11.34487 13.27670 15.08627 16.81189 18.47531 20.09024 21.66599 23.20925 24.72497 26.21697 27.68825 29.14124 30.57791 31.99993 33.40866 34.80531 36.19087 37.56623 38.93217 40.28936 41.63840 42.97982 44.31410 45.64168 46.96294 48.27824 49.58788 50.89218 52.19139 53.48577 54.77554 56.06091 57.34207 58.61921 59.89250 61.16209 62.42812 63.69074 76.15389
7.87944 10.59663 12.83816 14.86026 16.74960 18.54758 20.27774 21.95495 23.58935 25.18818 26.75685 28.29952 29.81947 31.31935 32.80132 34.26719 35.71847 37.15645 38.58226 39.99685 41.40106 42.79565 44.18128 45.55851 46.92789 48.28988 49.64492 50.99338 52.33562 53.67196 55.00270 56.32811 57.64845 58.96393 60.27477 61.58118 62.88334 64.18141 65.47557 66.76596 79.48998
Table of the Chi-squared distribution
Entries in table are χ2αpνq: the α tail quantile of Chi-squaredpνq distribution
0.95000 0.00393 0.10259 0.35185 0.71072 1.14548 1.63538 2.16735 2.73264 3.32511 3.94030 4.57481 5.22603 5.89186 6.57063 7.26094 7.96165 8.67176 9.39046
10.11701 10.85081 11.59131 12.33801 13.09051 13.84843 14.61141 15.37916 16.15140 16.92788 17.70837 18.49266 19.28057 20.07191 20.86653 21.66428 22.46502 23.26861 24.07494 24.88390 25.69539 26.50930 34.76425
in columns, ν given in rows.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com