Solution (source code)

= Solution

Choose a parametric baseline hazard $h_0(t;\eta)$ and fit
$$
h(t\mid z)=h_0(t;\eta)e^{\beta z}.
$$
Under independent <right censoring>, the full <survival likelihood> is
$$
L(\eta,\beta)=\prod_{i=1}^n
\bigl[h_0(x_i;\eta)e^{\beta z_i}\bigr]^{v_i}
\exp\!\left[-H_0(x_i;\eta)e^{\beta z_i}\right].
$$
Estimate $(\eta,\beta)$ by <maximum likelihood estimation> and test $H_0:\beta=0$ with a <likelihood-ratio test>, <Wald test>, or <score test>. Equality of the two event-time distributions is exactly $\beta=0$ within this model.