程序代写案例-MATH 523

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
Name: ID:
Midterm Exam VERSION A
MATH 523: Generalized Linear Models
February 25, 2020
Instructions
• This is a closed book exam.
• A
nswer both questions in the examination booklets provided.
• Calculators and translation dictionaries are permitted.
• R output and statistical tables are provided.
Good Luck!
Page 2
Problem 1. Consider the Geometric family of distributions with parameter pi P p0, 1q and
probability mass function
fpy; piq “ piyp1´ piq, y P t0, 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.
Page 3
Problem 2. Consider the following data on ear infections in swimmers from the 1990
Pilot Surf/Health Study of the New South 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) [5 marks] The data were first modeled with a GLM model m1 whose output is given
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.
Page 4
1 C a l l :
2 glm ( fo rmu la = NumInfec ˜ Age + Loc , f am i l y = po i s s o n )
3
4 Dev iance R e s i d u a l s :
5 Min 1Q Median 3Q Max
6 ´1.9905 ´1.5449 ´1.2971 0 .6723 7 .3326
7
8 C o e f f i c i e n t s :
9 Es t imate Std . E r r o r z v a l u e Pr (>| z | )
10 ( I n t e r c e p t ) 0 .17675 0.09387 1 .883 0.05972 .
11 Age20´24 ´0.34968 0.12411 ´2.817 0.00484 ∗∗
12 Age25´29 ´0.17896 0.12982 XXXX XXXX
13 LocNonBeach 0.50692 0.10430 4 .860 1 .17 e´06 ∗∗∗
14 ´´ ´
15 S i g n i f . codes : 0 ’∗∗∗ ’ 0 .001 ’∗∗ ’ 0 .01 ’∗ ’ 0 .05 ’ . ’ 0 . 1 ’ ’ 1
16
17 ( D i s p e r s i o n paramete r f o r p o i s s o n f am i l y taken to be 1)
18
19 Nu l l d e v i an c e : 824 .51 on 286 deg r e e s o f f reedom
20 Re s i d u a l d e v i an c e : 791 .77 on 283 deg r e e s o f f reedom
21 AIC : 1172 .2
22
23 Number o f F i s h e r S co r i ng i t e r a t i o n s : 6
24
25
26 C a l l :
27 glm ( fo rmu la = NumInfec ˜ Loc , f am i l y = po i s s o n )
28
29 Dev iance R e s i d u a l s :
30 Min 1Q Median 3Q Max
31 ´1.8632 ´1.4522 ´1.4522 0 .8182 6 .8595
32
33 C o e f f i c i e n t s :
34 Es t imate Std . E r r o r z v a l u e Pr (>| z | )
35 ( I n t e r c e p t ) 0 .05299 0.08032 0 .660 0 .509
36 LocNonBeach 0.49843 0.10280 4 .849 1 .24 e´06 ∗∗∗
37 ´´ ´
38 S i g n i f . codes : 0 ’∗∗∗ ’ 0 .001 ’∗∗ ’ 0 .01 ’∗ ’ 0 .05 ’ . ’ 0 . 1 ’ ’ 1
39
40 ( D i s p e r s i o n paramete r f o r p o i s s o n f am i l y taken to be 1)
41
42 Nu l l d e v i an c e : 824 .51 on 286 deg r e e s o f f reedom
43 Re s i d u a l d e v i an c e : 800 .36 on 285 deg r e e s o f f reedom
44 AIC : 1176 .8
45
46 Number o f F i s h e r S co r i ng i t e r a t i o n s : 6
Page 5
Table of the Chi-squared distribution
Entries in table are χ2αpνq: the α tail quantile of Chi-squaredpνq distribution
α given in columns, ν given in rows.
Left-tail Right-tail
ν 0.99500 0.99000 0.97500 0.95000 0.90000 0.10000 0.05000 0.02500 0.01000 0.00500
1 0.00004 0.00016 0.00098 0.00393 0.01579 2.70554 3.84146 5.02389 6.63490 7.87944
2 0.01003 0.02010 0.05064 0.10259 0.21072 4.60517 5.99146 7.37776 9.21034 10.59663
3 0.07172 0.11483 0.21580 0.35185 0.58437 6.25139 7.81473 9.34840 11.34487 12.83816
4 0.20699 0.29711 0.48442 0.71072 1.06362 7.77944 9.48773 11.14329 13.27670 14.86026
5 0.41174 0.55430 0.83121 1.14548 1.61031 9.23636 11.07050 12.83250 15.08627 16.74960
6 0.67573 0.87209 1.23734 1.63538 2.20413 10.64464 12.59159 14.44938 16.81189 18.54758
7 0.98926 1.23904 1.68987 2.16735 2.83311 12.01704 14.06714 16.01276 18.47531 20.27774
8 1.34441 1.64650 2.17973 2.73264 3.48954 13.36157 15.50731 17.53455 20.09024 21.95495
9 1.73493 2.08790 2.70039 3.32511 4.16816 14.68366 16.91898 19.02277 21.66599 23.58935
10 2.15586 2.55821 3.24697 3.94030 4.86518 15.98718 18.30704 20.48318 23.20925 25.18818
11 2.60322 3.05348 3.81575 4.57481 5.57778 17.27501 19.67514 21.92005 24.72497 26.75685
12 3.07382 3.57057 4.40379 5.22603 6.30380 18.54935 21.02607 23.33666 26.21697 28.29952
13 3.56503 4.10692 5.00875 5.89186 7.04150 19.81193 22.36203 24.73560 27.68825 29.81947
14 4.07467 4.66043 5.62873 6.57063 7.78953 21.06414 23.68479 26.11895 29.14124 31.31935
15 4.60092 5.22935 6.26214 7.26094 8.54676 22.30713 24.99579 27.48839 30.57791 32.80132
16 5.14221 5.81221 6.90766 7.96165 9.31224 23.54183 26.29623 28.84535 31.99993 34.26719
17 5.69722 6.40776 7.56419 8.67176 10.08519 24.76904 27.58711 30.19101 33.40866 35.71847
18 6.26480 7.01491 8.23075 9.39046 10.86494 25.98942 28.86930 31.52638 34.80531 37.15645
19 6.84397 7.63273 8.90652 10.11701 11.65091 27.20357 30.14353 32.85233 36.19087 38.58226
20 7.43384 8.26040 9.59078 10.85081 12.44261 28.41198 31.41043 34.16961 37.56623 39.99685
21 8.03365 8.89720 10.28290 11.59131 13.23960 29.61509 32.67057 35.47888 38.93217 41.40106
22 8.64272 9.54249 10.98232 12.33801 14.04149 30.81328 33.92444 36.78071 40.28936 42.79565
23 9.26042 10.19572 11.68855 13.09051 14.84796 32.00690 35.17246 38.07563 41.63840 44.18128
24 9.88623 10.85636 12.40115 13.84843 15.65868 33.19624 36.41503 39.36408 42.97982 45.55851
25 10.51965 11.52398 13.11972 14.61141 16.47341 34.38159 37.65248 40.64647 44.31410 46.92789
26 11.16024 12.19815 13.84390 15.37916 17.29188 35.56317 38.88514 41.92317 45.64168 48.28988
27 11.80759 12.87850 14.57338 16.15140 18.11390 36.74122 40.11327 43.19451 46.96294 49.64492
28 12.46134 13.56471 15.30786 16.92788 18.93924 37.91592 41.33714 44.46079 48.27824 50.99338
29 13.12115 14.25645 16.04707 17.70837 19.76774 39.08747 42.55697 45.72229 49.58788 52.33562
30 13.78672 14.95346 16.79077 18.49266 20.59923 40.25602 43.77297 46.97924 50.89218 53.67196
31 14.45777 15.65546 17.53874 19.28057 21.43356 41.42174 44.98534 48.23189 52.19139 55.00270
32 15.13403 16.36222 18.29076 20.07191 22.27059 42.58475 46.19426 49.48044 53.48577 56.32811
33 15.81527 17.07351 19.04666 20.86653 23.11020 43.74518 47.39988 50.72508 54.77554 57.64845
34 16.50127 17.78915 19.80625 21.66428 23.95225 44.90316 48.60237 51.96600 56.06091 58.96393
35 17.19182 18.50893 20.56938 22.46502 24.79665 46.05879 49.80185 53.20335 57.34207 60.27477
36 17.88673 19.23268 21.33588 23.26861 25.64330 47.21217 50.99846 54.43729 58.61921 61.58118
37 18.58581 19.96023 22.10563 24.07494 26.49209 48.36341 52.19232 55.66797 59.89250 62.88334
38 19.28891 20.69144 22.87848 24.88390 27.34295 49.51258 53.38354 56.89552 61.16209 64.18141
39 19.99587 21.42616 23.65432 25.69539 28.19579 50.65977 54.57223 58.12006 62.42812 65.47557
40 20.70654 22.16426 24.43304 26.50930 29.05052 51.80506 55.75848 59.34171 63.69074 66.76596
50 27.99075 29.70668 32.35736 34.76425 37.68865 63.16712 67.50481 71.42020 76.15389 79.48998

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: Fudaojun0228