**Program Code**

The program is written in JavaScript.

**Source**

The program uses the method of Peterson, B. and George, S.L. (1993). *Controlled
Clinical Trials*, 511-522 but where the expected probability of event for each stratum
is calculated using the accrual, follow-up and exponential failure and competing risk
assumptions. The total sample size is calculated as follows

*N=(q(1-**a/2)+q(1-b)) ^{2} * S[1/(e_{ij}*l_{ij})]/D^{2}*

Where *f _{ij} *are the cell frequencies and e

*D=log(D _{1}/D_{2})*

Where

*D _{j}=l_{1j}/l_{2j} is the hazard ratio for
the treatment effect within stratum j*

**Input Items**

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

- a, the significance level (.05)
- One-sided or two-sided test
- Accrual time
- T, the follow-up time
- Competing Risk: the hazard of the competing risk random variable
- f
_{11}, f_{12}, f_{21}, and f_{22}, the cell frequencies. By way of example, f_{11}is cell frequency in treatment group 1 and stratum 1. Note that*S*f_{ij}=1. (.25 for each cell) - l
_{11}and l_{21}, the hazard rates for treatment 1 in stratum 1 and 2, respectively, which give the baseline hazard rates for failure. - D
_{1}and D_{2}, the hazard ratios between treatment 1 and treatment 2 within each stratum. - 1-b, the desired power for sample size estimation, or n, the total sample size for power estimation