**Program Code**

The program is written in JavaScript.

**References**

Lawless, Jerald F. *Statistical Models and Methods for Lifetime Data*. 2nd ed. John Wiley &
Sons, 2003.

**Description**

The formulas are based on the assumptions of uniform accrual over time, no loss to follow-up, exponentially distributed death times, and use of the exponential MLE test. The important normal approximation used in the sample size and power calculations is equation 4.1.5 (page 149) of Lawless:

$$ Z = \frac{\hat{\phi} - \phi}{I_1(\hat{\phi})^{-1/2}} \sim N(0,1) $$ Here, \(\phi\) is the cube root transformed hazard ratio under the null hypothesis, \(\hat{\phi}\) is the cube root transformed hazard ratio under the alternative, and \(I_1(\hat{\phi}) = 9r/\hat{\phi}^2\) (where \(r\) is the expected number of deaths) is the observed Fisher information. This leads to the following sample size formula: $$ n = \left( \frac{\sigma_0 \, z_{1-\alpha/s} + \sigma_1 \, z_{1-\beta}}{|\hat{\phi} - \phi|} \right)^2 + \frac{1}{2} $$ as well as the following power formula: $$ power = P \! \left( Z \leq \frac{\sigma_0 \, z_{\alpha/s} + |\hat{\phi} - \phi| \sqrt{n}}{\sigma_1} \right) $$ Here, \(\sigma_0\) and \(\sigma_1\) represent the null and alternative standard deviations, respectively, and \(z_p\) is the \(p\)th quantile of a standard normal distribution.**Input Items**

The user is prompted to enter values for the following items. For items that have initial default values set, the values are given in parentheses.

- Length of the accrual period
- Length of the follow-up period, i.e. the time from end of accrual to analysis
- \(\alpha\), the significance level (0.05)
- One-sided or two-sided test (1)
- \(M_0\) and \(M_a\), the median survival times for the null and alternative hypotheses, respectively. The outcome is assumed to be exponentially distributed. Note, there is a simple connection between median survival (\(M\)) and hazard rate (\(\lambda\)) for exponential data. The hazard rate is computed as follows: $$ \lambda = - \frac{\log(0.5)}{M} $$
- Survival probabilities for the null and alternative at time \(t\). The outcome is assumed to be exponentially distributed. Note, there is a simple connection between survival probabilities and hazard rates for exponential data. The hazard rate is computed as follows: $$ \lambda = - \frac{\log(S(t))}{t} $$ where \(S(t)\) is the survivor function at time \(t\).
- \(1 - \beta\), the desired power for accrual rate estimation (0.9), or \(n\), the sample size for power estimation.

**Output items**

- Sample size or power, depending on the selected calculation.
- Upper and lower critical values for either median survival or for survival probabilities from the parametric exponential model. Wider intervals are needed for estimates based on the Kaplan-Meier estimate of the survival function.