11.6 Practice problems
Problem 11.6.1. For the insecticide data of Example 11.2.3, with \(\operatorname {logit}\hat \pi = -3.036 + 1.012x\):
- (a)
- estimate the probability of death at dose \(4.5\);
- (b)
- estimate the dose that kills \(90\%\) of the insects.
Show solution
Solution. (a) \(\hat \eta = -3.036 + 1.012(4.5) = 1.518\), so \(\hat \pi = 1/(1 + e^{-1.518}) = 0.820\).
(b) \(\pi = 0.9\) where \(\eta = \log (0.9/0.1) = \log 9 = 2.197\), so \(x = (2.197 + 3.036)/1.012 = 5.17\). This is just beyond the largest dose used, so it is a mild extrapolation.
Problem 11.6.2. Five junctions of design \(A\) had \(40\) accidents in a year and five junctions of design \(B\) had \(20\). Fit the Poisson model \(\log \mu = \beta _0 + \beta _1z\), with \(z = 1\) for design \(B\), assuming every junction has the same mean within its design. Show that \(\hat \beta _1 = \log (\bar y_B/\bar y_A)\) and \(\widehat {\operatorname {Var}}(\hat \beta _1) = 1/Y_A + 1/Y_B\), where \(Y_A\), \(Y_B\) are the group totals, and test whether the designs differ.
Show solution
Solution. The likelihood equations \(\mathbf {X}^\top \mathbf {y} = \mathbf {X}^\top \hat {\boldsymbol \mu }\), with columns \(\mathbf {1}\) and \(\mathbf {z}\), say that the fitted totals match the observed totals overall and in group \(B\), hence in each group: \(5e^{\hat \beta _0} = Y_A\) and \(5e^{\hat \beta _0 + \hat \beta _1} = Y_B\). So \(e^{\hat \beta _0} = \bar y_A\) and \(e^{\hat \beta _1} = \bar y_B/\bar y_A\). The weights are \(w_i = \hat \mu _i\), so, as in Theorem 11.2.4, \[ \mathbf {X}^\top \hat {\mathbf {W}}\mathbf {X} = \begin {pmatrix} Y_A + Y_B & Y_B \\ Y_B & Y_B \end {pmatrix} , \qquad \widehat {\operatorname {Var}}(\hat \beta _1) = \frac {Y_A + Y_B}{Y_AY_B} = \frac {1}{Y_A} + \frac {1}{Y_B} . \] Here \(\hat \beta _1 = \log (4/8) = -0.693\) and \(\operatorname {se} = \sqrt {1/40 + 1/20} = 0.274\), so \(Z_0 = -2.53\), beyond \(-1.96\). Design \(B\) halves the accident rate, with a \(95\%\) interval for the rate ratio of \((e^{-1.230}, e^{-0.156}) = (0.29, 0.86)\).
Problem 11.6.3. The gamma distribution with mean \(\mu \) and shape \(\nu \) has density \(f(y) = \dfrac {1}{\Gamma (\nu )}\Bigl (\dfrac {\nu }{\mu }\Bigr )^\nu y^{\nu - 1}e^{-\nu y/\mu }\), \(y > 0\). Show that it belongs to the exponential family, and find \(\theta \), \(b(\theta )\), \(a(\phi )\), the variance function and the canonical link.
Show solution
Solution. \[ \log f = \nu \Bigl (-\frac {y}{\mu } - \log \mu \Bigr ) + \nu \log \nu + (\nu - 1)\log y - \log \Gamma (\nu ) . \] This has the form \([y\theta - b(\theta )]/a(\phi ) + c(y, \phi )\) with \(\theta = -1/\mu \), \(b(\theta ) = \log \mu = -\log (-\theta )\) and \(a(\phi ) = 1/\nu \). Then \(b'(\theta ) = -1/\theta = \mu \), as it must be, and \(b''(\theta ) = 1/\theta ^2 = \mu ^2\), so \(V(\mu ) = \mu ^2\) and \(\operatorname {Var}(y) = \mu ^2/\nu \): the standard deviation is proportional to the mean, the situation of Section 6 in which the log transformation stabilises the variance. The canonical link is \(g(\mu ) = -1/\mu \), usually used as \(1/\mu \), the reciprocal link.
Problem 11.6.4. Show that for a Poisson regression with log link and an intercept, \(\sum (y_i - \hat \mu _i) = 0\), so that \(D = 2\sum y_i\log (y_i/\hat \mu _i)\). Check the deviance of Example 11.5.1 with this formula.
Show solution
Solution. By Theorem 11.4.2(iii), the likelihood equation for the column of ones is \(\sum y_i = \sum \hat \mu _i\), so the term \(\sum (y_i - \hat \mu _i)\) vanishes. For the faults data, \begin {align*} D &= 2\Bigl [2\log \tfrac {2}{2.309} + 3\log \tfrac {3}{3.380} + 6\log \tfrac {6}{4.948} \\ &\qquad + 7\log \tfrac {7}{7.243} + 11\log \tfrac {11}{10.602} + 15\log \tfrac {15}{15.518}\Bigr ] \\ &= 2\bigl [-0.2877 - 0.3581 + 1.1565 - 0.2386 + 0.4059 - 0.5092\bigr ] = 0.338 , \end {align*}
as before.
Problem 11.6.5. A Poisson regression with \(p = 3\) coefficients was fitted to counts from \(n = 9\) hospitals. A coefficient had \(\hat \beta _j = 0.42\) with \(\operatorname {se} = 0.15\), and Pearson’s \(X^2 = 18.6\). Is there evidence of overdispersion? Re-assess the coefficient using the quasi-Poisson model.
Show solution
Solution. \(X^2 = 18.6\) on \(n - p = 6\) degrees of freedom exceeds \(\chi ^2_{0.05,6} = 12.59\), and \(\hat \phi = 18.6/6 = 3.1\): the counts vary about three times as much as a Poisson model allows. The corrected standard error is \(0.15\sqrt {3.1} = 0.264\), so \(Z_0\) falls from \(0.42/0.15 = 2.8\) to \(0.42/0.264 = 1.59\), no longer significant at the \(5\%\) level. The apparent effect was largely a consequence of understating the variability.
Problem 11.6.6. Consider the normal distribution with identity link. Show that one step of iteratively reweighted least squares, from any starting value, gives the least-squares estimate. Show also that the deviance is \(SS_{\mathrm {Res}}\).
Show solution
Solution. Here \(V(\mu ) = 1\) and \(g'(\mu ) = 1\), so \(w_i = 1\) and \(z_i = \eta _i + (y_i - \mu _i) = y_i\), since \(\eta _i = \mu _i\). The step is \((\mathbf {X}^\top \mathbf {X})^{-1}\mathbf {X}^\top \mathbf {y}\), whatever \(\boldsymbol \beta ^{(t)}\) was. For the deviance, \(\ell = -\sum (y_i - \mu _i)^2/(2\sigma ^2) + \text {const}\); the saturated model has \(\mu _i = y_i\) and \(\ell = \text {const}\), so \(D = 2\sigma ^2[\ell (\text {saturated}) - \ell (\hat {\boldsymbol \beta })] = \sum (y_i - \hat \mu _i)^2 = SS_{\mathrm {Res}}\). The likelihood ratio test is then based on differences of residual sums of squares, as in the extra-sum-of-squares principle.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.