# Interaction Binomial Power/Sample Size

Program Code

The program is written in JavaScript.

Source

The program uses the approximate variance of the logarithm of the ratio of odds ratio. Fleiss, J.L. Statistical Rates and Proportions (1981), page 165 provides the variance estimate for an estimated odds ratio. The total sample size is calculated as follows

N = (q(1-a/2)+q(1-b))2 * S [1/fij*(pij*(1-pij))]/D2

Where fij are the cell frequencies and pij are the event probabilities in treatment i and stratum j, q is the inverse normal function, and

D=log(o1/o2)

Where

oj = p1j(1-p2j)/(p2j(1-p1j)) is the odds ratio for the treatment effect within stratum j

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
• f11, f12, f21, and f22, the cell frequencies.  By way of example, f11 is cell frequency in treatment group 1 and stratum 1. Note that S fij =1. (.25 for each cell)
• p11 and p21, the event probabilities for treatment 1 in stratum 1 and 2, respectively, which give the baseline probabilities of failure in each stratum.
• o1 and o2, the odds ratios between treatment 1 and treatment 2 within each of the strata.
• 1-b, the desired power for sample size estimation, or n, total sample size for power estimation