**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(std./exp.)/HREquiv(std./exp.)
)*

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

**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 Period
- Follow-up Period after Accrual Period
- Competing Risk: the hazard rate of the competing risk random variable
- Hazard rate for experimental treatment
- Hazard ratios between experimental and standard. [HR(std./exp.)]
- Hazard ratios between experimental and standard defining noninferiority. [HREquiv(std./exp.)]
- Desired power for sample size estimation or total sample size for power estimation