Paper 4, Section II, J

Statistical Modelling | Part II, 2017

The dataset diesel records the number of diesel cars which go through a block of Hills Road in 6 disjoint periods of 30 minutes, between 8AM and 11AM. The measurements are repeated each day for 10 days. Answer the following questions based on the code below, which is shown with partial output.

(a) Can we reject the model fit. 1 at a 1%1 \% level? Justify your answer.

(b) What is the difference between the deviance of the models fit. 2 and fit.3?

(c) Which of fit. 2 and fit. 3 would you use to perform variable selection by backward stepwise selection? Why?

(d) How does the final plot differ from what you expect under the model in fit.2? Provide a possible explanation and suggest a better model.

>> head (diesel)

period num.cars day

11691\begin{array}{llll}1 & 1 & 69 & 1\end{array}

22971\begin{array}{lllll}2 & 2 & 97 & 1\end{array}

331031\begin{array}{llll}3 & 3 & 103 & 1\end{array}

44991\begin{array}{llll}4 & 4 & 99 & 1\end{array}

55671\begin{array}{llll}5 & 5 & 67 & 1\end{array}

669116 \quad 6 \quad 911

>> fit. 1=1= glm(num.cars period, data=diesel, family=poisson)

summary (fit.1)

Deviance Residuals:

Min 1Q Median 3Q Max

4.01881.48370.21171.62574.5965\begin{array}{lllll}-4.0188 & -1.4837 & -0.2117 & 1.6257 & 4.5965\end{array}

Coefficients:

Estimate Std. Error zz value Pr(>z)\operatorname{Pr}(>|z|)

(Intercept) 4.6285350.029288158.035<2e164.628535 \quad 0.029288158 .035<2 \mathrm{e}-16 * * *

period 0.0060730.0075510.8040.421-0.006073 \quad 0.007551-0.804 \quad 0.421

Signif. codes: 0 ? * * * ? 0.001??0.010.001 ? * * ? 0.01 ? * ? 0.050.05 ?.? 0.10.1 ? ? 1

(Dispersion parameter for poisson family taken to be 1)

Null deviance: 262.36262.36 on 59 degrees of freedom

Residual deviance: 261.72261.72 on 58 degrees of freedom

AIC: 651.2651.2

>> diesel$period.factor = factor(diesel$period)

>> fit. 2=2= glm (num.cars period.factor, data=diesel, family=poisson)

summary\operatorname{summary} (fit.2)

Coefficients:

Estimate Std. Error z value Pr(>z)\operatorname{Pr}(>|z|)

Part II, 20172017 \quad List of Questions

[TURN OVER

Typos? Please submit corrections to this page on GitHub.