**Program Code**

Two Stage is available as a both a JavaScript and Server-side program. The JavaScript version may be downloaded as a Web page and run without an Internet connection. The Server-side version is provided in case your Web browser does not adequately support JavaScript (for example, Microsoft Pocket PC Phone browser). Both were coded by CRAB programmer Brent Hostetler. The original code was written in FORTRAN by an unidentified SWOG programmer.

**Accessing the Program**

The SWOG Web page under Stat Tools.

**Sample Sizes for a Multi-stage Phase II Trial**

**Source**

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.

**Definition of Variables**

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

P_{0} |
The largest success probability which, if true, would imply that the treatment regimen does not warrant further investigation. |

P_{a} |
The smallest success probability which, if true, would imply that the treatment regimen DOES warrant further investigation. |

a_{l} |
If the number of successes
after completing the first stage is < al, we reject the alternative hypothesis
that p > Pa. |

r_{l} |
If the number of successes
after completing the first stage is > r_{l}, we reject the null
hypothesis that p < P_{0}. |

a_{2} |
If the number of successes
after completing the trial is < a_{2} then we reject the alternative
hypothesis. |

r_{2} |
If the number of successes
after completing the trial is > r_{2} then we reject the null
hypothesis. |

N_{1} |
Sample size for the first stage. |

N_{2} |
Sample size for the second stage. |

N | Total sample size. |

Z_{a} |
The probit of 1-a. (The Z value corresponding the alpha level: i.e., 1.6449 for a significance level of .05.) |

p_{x} |
The probability of accepting
the null, given P_{a} is true, is < p_{x}. (See details in SWOG
option.) |

Z_{x} |
The probit of 1-p_{x}. |

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

- a, the significance level (.05) (unless already specified through another option).

- 1-b, the power (.9 unless specified).

- P
_{0}(latest value).

- P
_{a}(latest value).

**2) SWOG Rule for Finding the a _{i}'s and r_{i}'s**

In this option both P_{0} and P_{a} are specified, along with the value
p_{x}; a_{l} and r_{l} are calculated differently from in the
Fleming option. a_{1} is calculated to be the largest x such that the probability
of getting a smaller value than x (given P_{a} is true) is <= p_{x}.

The power is calculated for an array of P_{a} values, which are in an input
file created by this program; you may edit this file. The editing feature is mainly
intended for the P_{a} values, which have defaults ranging from P_{0}+.1
to P_{0}+.35. It may also be used to edit the a_{i} and r_{i}. **Warning**:
The program will only find the power for the values given in this file - it will not
recalculate the a_{i} and r_{i}, or any other 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 H
_{0})/P_{0}. This means the probability of stopping early because of accepting H_{0}given that P_{0}is the true probability. The probability of accepting H_{a}given that P_{0}is the true probability, PE(acc H_{a})/P_{0}, is also given (and the analogous stuff for P_{a}).