Paper 3, Section I, J

Statistical Modelling
Part II, 2018

The data frame Cases. of .flu contains a list of cases of flu recorded in 3 London hospitals during each month of 2017 . Consider the following RR code and its output.

table (Cases. of.flu)

Month Hospital

 Month  A  B  C  April 104027\begin{array}{lrrr}\text { Month } & \text { A } & \text { B } & \text { C } \\ \text { April } & 10 & 40 & 27\end{array}

 April 104027 August 93419\begin{array}{lrrr}\text { April } & 10 & 40 & 27 \\ \text { August } & 9 & 34 & 19\end{array}

 August 93419 December 2412981\begin{array}{lrrr}\text { August } & 9 & 34 & 19 \\ \text { December } & 24 & 129 & 81\end{array}

 December 2412981 February 4913474\begin{array}{llll}\text { December } & 24 & 129 & 81 \\ \text { February } & 49 & 134 & 74\end{array}

 February 4913474 January 4513878\begin{array}{llll}\text { February } & 49 & 134 & 74 \\ \text { January } & 45 & 138 & 78\end{array}

 July 513878113635\begin{array}{lrrr}\text { July } & 5 & 138 & 78 \\ & 11 & 36 & 35\end{array}

 June 113622\begin{array}{llll}\text { June } & 11 & 36 & 22\end{array}

 March 208241\begin{array}{llll}\text { March } & 20 & 82 & 41\end{array}

May 543235 \quad 43 \quad 23

November 17826217 \quad 82 \quad 62

October 626196 \quad 26 \quad 19

September 64021640 \quad 21

Cases. of.flu.table = as.data.frame (table (Cases. of .flu))

>> head (Cases. of .flu.table)

Month Hospital Freq

1 April A 10

2 August A 9

3 December A 24

4 February A 49

5 January A 45

6 July A 5

>mod1=>\bmod 1= glm (Freq ., data=Cases. of .flu.table, family=poisson)

>mod1$dev>\bmod 1 \$ \mathrm{dev}

[1] 28.5183628.51836

levels (Cases. of.flu$Month)

Describe a test for the null hypothesis of independence between the variables Month and Hospital using the deviance statistic. State the assumptions of the test.

Perform the test at the 1%1 \% level for each of the two different models shown above. You may use the table below showing 99 th percentiles of the χp2\chi_{p}^{2} distribution with a range of degrees of freedom pp. How would you explain the discrepancy between their conclusions?