This is an implementation of the sample size calculation formula
derived by Schmoor et al. (2000) for
the following Cox proportional hazards regression in the epidemoilogical
studies:
$$h(t|x_1, x_2)=h_0(t)\exp(\beta_1 x_1+\beta_2 x_2 + \gamma (x_1 x_2)),$$
where both covariates $X_1$ and $X_2$ are binary variables.Suppose we want to check if
the hazard ratio of the interaction effect $X_1 X_2=1$ to $X_1 X_2=0$ is equal to $1$
or is equal to $\exp(\gamma)=\theta$.
Given the type I error rate $\alpha$ for a two-sided test, the total
number of subjects required to achieve a power of $1-\beta$ is
$$n=\frac{\left(z_{1-\alpha/2}+z_{1-\beta}\right)^2\delta}{[\log(\theta)]^2 \psi},$$
where
$\psi$ is the proportion of subjects died of
the disease of interest,
$$\delta=\frac{1}{p_{00}}+\frac{1}{p_{01}}+\frac{1}{p_{10}}
+\frac{1}{p_{11}},$$
and
$p_{00}=Pr(X_1=0,\mbox{and}, X_2=0)$,
$p_{01}=Pr(X_1=0,\mbox{and}, X_2=1)$,
$p_{10}=Pr(X_1=1,\mbox{and}, X_2=0)$,
$p_{11}=Pr(X_1=1,\mbox{and}, X_2=1)$.