Exercise 22.1

Part a. Individual \(i\) has \(h_i(t) = \lambda e^{\beta x_i} e^t\) and \(S_i(t) = \exp(-\lambda e^{\beta x_i}(e^t - 1))\).

The log-likelihood is: \[\ell(\lambda,\beta) = \sum_{i=1}^n \left[\delta_i\left(\log\lambda + \beta x_i + t_i\right) - \lambda e^{\beta x_i}(e^{t_i}-1)\right].\]

Using \(\sum_i \delta_i = r\): \[\ell(\lambda,\beta) = r\log\lambda + \beta\sum_{i=1}^n \delta_i x_i + \sum_{i=1}^n \delta_i t_i - \lambda\sum_{i=1}^n e^{\beta x_i}(e^{t_i}-1).\]

Part b. Score equations:

With respect to \(\lambda\): \[\frac{\partial\ell}{\partial\lambda} = \frac{r}{\lambda} - \sum_{i=1}^n e^{\beta x_i}(e^{t_i}-1) = 0.\]

With respect to \(\beta\): \[\frac{\partial\ell}{\partial\beta} = \sum_{i=1}^n \delta_i x_i - \lambda\sum_{i=1}^n x_i e^{\beta x_i}(e^{t_i}-1) = 0.\]

Part c. From the \(\lambda\)-equation: \[\hat\lambda = \frac{r}{\displaystyle\sum_{i=1}^n e^{\hat\beta x_i}(e^{t_i}-1)}.\]

Substituting into the \(\beta\)-equation and rearranging, the single equation in \(\hat\beta\) only is:

\[\frac{r}{\displaystyle\sum_{i=1}^n \delta_i x_i} = \frac{\displaystyle\sum_{i=1}^n e^{\hat\beta x_i}(e^{t_i}-1)}{\displaystyle\sum_{i=1}^n x_i e^{\hat\beta x_i}(e^{t_i}-1)}.\]

Because \(x_i\) is binary, this equation can in fact be solved in closed form. Write \(r_1=\sum_i\delta_i x_i\) (events with \(x_i=1\)), \(r_0=r-r_1\), \(A_1=\sum_i x_i(e^{t_i}-1)\) and \(A_0=\sum_i (1-x_i)(e^{t_i}-1)\). Then \(\sum_i e^{\beta x_i}(e^{t_i}-1)=A_0+e^{\beta}A_1\) and \(\sum_i x_i e^{\beta x_i}(e^{t_i}-1)=e^{\beta}A_1\), so the equation becomes \[r\,e^{\hat\beta}A_1 = r_1\,(A_0+e^{\hat\beta}A_1)\quad\Longleftrightarrow\quad r_0\,e^{\hat\beta}A_1=r_1A_0,\] which is linear in \(e^{\hat\beta}\): \[e^{\hat\beta}=\frac{r_1}{r_0}\cdot\frac{A_0}{A_1}=\frac{\sum_i \delta_i x_i}{\sum_i \delta_i(1-x_i)}\cdot\frac{\sum_i(1-x_i)(e^{t_i}-1)}{\sum_i x_i(e^{t_i}-1)}.\] Substituting back, \(\hat\lambda = r_0/A_0\), i.e. the number of events in the \(x=0\) group divided by its cumulated \((e^{t_i}-1)\). (For a continuous covariate no such closed form exists and the equation must be solved numerically, e.g. by Newton–Raphson.)

End of Solutions to Exercises 22