Solution (source code)

= Solution

In a <constant hazard survival model>, the <maximum-likelihood estimator> is the number of observed events divided by total <person-time at risk>. Treatment A contributes $3$ deaths in $1+2+3+3+5=14$ months, while Treatment B contributes $2$ deaths in $1+5+5+7+10=28$ months. Hence
$$
\widehat h_A=\frac3{14},
\qquad
\widehat h_B=\frac2{28}=\frac1{14},
\qquad
\widehat{\operatorname{HR}}=3.
$$