# Two Stage

### Program Code

The program is written in R.

### Sources

For background information see the book by Green, Benedetti and Crowley:

• Green SJ, Benedetti J., and Crowely J., Clinical Trials in Oncology, Chapman and Hall, 1997.
• Green SJ and Dahlberg S. (1992). Planned Versus Attained Design in Phase II Clinical Trials. Statistics in Medicine 11:853-862.

### Error Thresholds

#### Stage 1 Error Threshold

Probability threshold for failing to reject the null at stage 1 when alternative is true; In other words, it is the probability threshold for erroneously accepting early futility defined as below:

P(X ≤ a1 | n1, pa)

Probability threshold for rejecting the null at stage 1 when the null is true; In other words, it is the probability threshold for erroneously rejecting futility at stage 1 and is defined as below:

P(X ≥ r1 | n1, p0)

#### Stage 2 Error Threshold

Probability threshold for rejecting the null at stage 2 when the null is true; In other words, it is the probability threshold for erroneously rejecting futility at stage 2 and is defined as below:

P(X ≥ r2 | n1 + n2, p0)

### Definition of Variables

These are definitions of all variables referred to in the documentation:

• p0: The largest success probability which, if true, would imply that the treatment regimen does not warrant further investigation due to treatment futility.
• pa: The smallest success probability which, if true, would imply that the treatment regimen DOES warrant further investigation.
• al: If the number of successes after completing the first stage is < al, we reject the alternative hypothesis that p > pa.
• rl: If the number of successes after completing the first stage is > rl, we reject the null hypothesis that p < p0 under the futility only design; and in favor of the alternative: p > p1 that establishes treatment efficacy under the futility + efficacy design.
• a2: If the number of successes after completing the trial is < a2 then we reject the alternative hypothesis.
• r2: If the number of successes after completing the trial is > r2 then we reject the null hypothesis.
• n1: Sample size for the first stage.
• n2: Sample size for the second stage.
• N: Total sample size.
• px: The probability of accepting the null, given pa is true, is < px.

### Running the Program

The user is prompted for the type of calculation to be performed. There are 4 calculation steps. The first step determines the overall sample size for the design. The second step calculates the sample sizes for each stage. The third step determines SWOG critical values for the design (which can be modified by the user) and final step calculates design probabilities for the given study.

### 1) N (Sample Size Needed for a Two Stage Study)

The user is prompted for values to the following items.

• α, the significance level (.05) (unless already specified through another option).
• 1 - β, the power (.9 unless specified).
• p0 (latest value).
• pa (latest value).

### 2) SWOG Rule for Finding the a1's and r1's

In this option both p0 and pa are specified, along with the value px; al and rl are calculated differently from in the Fleming option. a1 is calculated to be the largest x such that the probability of getting a smaller value than x (given pa is true) is <= px.

The power is calculated for an array of pa values.

• The output also includes the probabilities for stopping early. Because of space restriction there are rather terse abbreviations for these. An example is: PE(acc H0)/p0. This means the probability of stopping early because of accepting H0 given that p0 is the true probability. The probability of accepting HA given that p0 is the true probability, PE(acc HA)/p0, is also given (and the analogous stuff for pa).