Solution (source code)

= Solution

Let $Y_i$ be the number of survivors among the $n_i$ patients in row $i$. The fitted <grouped-binomial logistic regression> is
$$
Y_i\ \mathrel{\mathop\sim^{\mathrm{ind}}}\ \operatorname{Bin}(n_i,p_i),
$$
with
$$
\log\frac{p_i}{1-p_i}
=\beta_0+\beta_B\mathbf1\{\text{site}_i=B\}
+\beta_C\mathbf1\{\text{site}_i=C\}
+\beta_M\mathbf1\{\text{malignant}_i=\text{yes}\}.
$$
Site A and nonmalignant tumours are the reference levels. There is no site-by-malignancy interaction, so the malignancy log-odds effect is assumed to be the same at all three sites. In the R call, `survive/total` supplies the observed proportions and `weights = total` supplies the binomial denominators $n_i$.