This is an implementation of the calculation of the number of required deaths
derived by Latouche et al. (2004)
for the following Cox proportional hazards regression in the epidemiological
studies:
$$h(t|x_1, x_2)=h_0(t)\exp(\beta_1 x_1+\beta_2 x_2),$$
where the covariate \(X_1\) is of our interest. The covariate \(X_1\) should be
a binary variable taking two possible values: zero and one, while the
covariate \(X_2\) can be binary or continuous.
Suppose we want to check if the hazard of \(X_1=1\) is equal to
the hazard of \(X_1=0\) or not. Equivalently, we want to check if
the hazard ratio of \(X_1=1\) to \(X_1=0\) is equal to \(1\)
or is equal to \(\exp(\beta_1)=\theta\).
Given the type I error rate \(\alpha\) for a two-sided test, the total
number of deaths required to achieve a power of \(1-\beta\) is
$$D=\frac{\left(z_{1-\alpha/2}+z_{1-\beta}\right)^2}{
[\log(\theta)]^2 p (1-p) (1-\rho^2),
}$$
where \(z_{a}\) is the \(100 a\)-th percentile of the standard normal distribution, $$\rho=corr(X_1, X_2)=(p_1-p_0)\times \sqrt{\frac{q(1-q)}{p(1-p)}},$$
and
\(p=Pr(X_1=1)\), \(q=Pr(X_2=1)\), \(p_0=Pr(X_1=1|X_2=0)\),
and \(p_1=Pr(X_1=1 | X_2=1)\).
\(p\) and \(rho\) will be estimated from a pilot data set.