**Program Code**

Both the JavaScript and Server-side versions were coded by CRAB programmer Brent Hostetler. Original code was written in FORTRAN by unidentified SWOG programmer.

**Source**

Fleiss JL, Tytun A, Ury HK (1980). A simple approximation for calculating sample sizes
for comparing independent proportions. *Biometrics* 36, 343-346.

The formulas are based on the classic critical ratio test with continuity correction. Do not use this program for conditions under which normal approximations do not hold. In the case of equal sample sizes, sample sizes will be identical to the tables in Fleiss: Statistical Methods for Rates and Proportions. For estimates of power, an additional approximation is used. For the case of equal sample sizes, this approximation is accurate for values of N (the number of cases in each group), and D (the absolute value of the difference in proportions to be detected), such that:

*D(N-2/D)>=4.*

For the case of unequal sample sizes, you should consult the paper for conditions under which this approximation is accurate.

**Running the Program**

Enter the type of calculation to be performed: Either estimate sample size or estimate power. Enter the input items listed below. Some items have initial default values.

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

- a, the significance level (.05)

- One-sided or two-sided test

- P
_{1}, the proportion of successes in Group 1

- P
_{2}, the proportion of successes in Group 2, where P_{2}>P_{1}

- n
_{2}/n_{1}, the sample size ratio of Group 2 to Group 1 (1)

- 1-b, the desired power for sample size estimation, or n, the total sample size for power estimation

Output Items

If sample size estimation is requested, the total sample size is output; otherwise the power is output.