**Program Code**

The program is written in JavaScript.

**Input**

*Follow-up Time*: Enter the number of years between the last patient accrual to
the time of the final analysis.

*Accrual Time*: Enter the number of years of patient accrual.

*Sample Size:* Enter n, the planned sample size.

*Hazard rate*: Enter l, the exponential death rate.

*Survival probability and time(default):* Enter a time, *t* (in years), and
the probability of patients alive at that time, *S(t)*. The program will calculate l as follows.

*l**=-1n(S(t))/t*

*Percentage of patients cured*: A number between 0 and 1.

**Calculation of the Expected Number of Deaths**

Probability of death at analysis time is

*P(death|Analysis time t)=1 - e ^{(-}*

At times before accrual has completed

*P(death|t) =(**l*^{-1}*e ^{(-}*

At other times

*P(death|t) = 1 - e ^{(-}*

The survival density *f(t)* is assumed to be exponential with rate *l* and cure rate *p*,
i.e.,

*f(t)=(1-p)(**l**)e ^{(-}*

**Output**

There are three options for calculations. The default option is a table of results in new page. The second and third options provide expected deaths for a given time, or time at which the expected proportion of deaths have occurred.