**Program Code**

The program is written in JavaScript.

**Source**

The program uses the following formula for the total sample size

*N=(q(1-alpha)+q(Power))**2*Sum
[1/(fi*ei)]/Delta**2*

Where *fi* is the proportion of the sample in
treatment i and e*i* are the event probabilities in treatment *i, q* is the
inverse normal function and

*Delta=log(HR(exp./std.)/HREquiv(exp./std.)
)*

Where HR(exp./std.) is the hazard ratio between the experimental and standard treatments and HREquiv(exp./std.) is the hazard ratio defining equivalence.

**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.

- Significance level (.05)
- One-sided test
- Accrual time
- Follow-up time
- Competing Risk: the hazard of the competing risk random variable
- Hazard rate for experimental treatment
- Hazard ratios between experimental and standard. [HR(exp./std.)]
- Hazard ratios between experimental and standard defining equivalence. [HREquiv(exp./std.)]
- Desired power for sample size estimation or total sample size for power estimation