The POWER Procedure

Analyses in the TWOSAMPLEFREQ Statement

Overview of the 2 times 2 Table

Notation:

Outcome
Failure Success
Group 1 n 1 minus x 1 x 1 n 1
2 n 2 minus x 2 x 2 n 2
upper N minus m m N

StartLayout 1st Row 1st Column x 1 2nd Column equals number-sign successes in group 1 2nd Row 1st Column x 2 2nd Column equals number-sign successes in group 2 3rd Row 1st Column m 2nd Column equals x 1 plus x 2 equals total number-sign successes 4th Row 1st Column ModifyingAbove p 1 With caret 2nd Column equals StartFraction x 1 Over n 1 EndFraction 5th Row 1st Column ModifyingAbove p 2 With caret 2nd Column equals StartFraction x 2 Over n 2 EndFraction 6th Row 1st Column ModifyingAbove p With caret 2nd Column equals StartFraction m Over upper N EndFraction equals w 1 ModifyingAbove p 1 With caret plus w 2 ModifyingAbove p 2 With caret EndLayout

The hypotheses are

StartLayout 1st Row 1st Column upper H 0 colon 2nd Column p 2 minus p 1 equals p 0 2nd Row 1st Column upper H 1 colon 2nd Column StartLayout Enlarged left-brace 1st Row 1st Column p 2 minus p 1 not-equals p 0 comma 2nd Column two hyphen sided 2nd Row 1st Column p 2 minus p 1 greater-than p 0 comma 2nd Column upper one hyphen sided 3rd Row 1st Column p 2 minus p 1 less-than p 0 comma 2nd Column lower one hyphen sided EndLayout EndLayout

where p 0 is constrained to be 0 for the likelihood ratio and Fisher’s exact tests. If p 0 less-than 0 in an upper one-sided test or p 0 greater-than 0 in a lower one-sided test, then the test is a noninferiority test. If p 0 greater-than 0 in an upper one-sided test or p 0 less-than 0 in a lower one-sided test, then the test is a superiority test. Although p 0 is unconstrained for the Pearson chi-square test, p 0 not-equals 0 is not recommended for that test. The Farrington-Manning score test is a better choice when p 0 not-equals 0.

Internal calculations are performed in terms of p 1, p 2, and p 0. An input set consisting of OR, p 1, and normal upper O normal upper R Subscript 0 is transformed as follows:

StartLayout 1st Row 1st Column p 2 2nd Column equals StartFraction left-parenthesis normal upper O normal upper R right-parenthesis p 1 Over 1 minus p 1 plus left-parenthesis normal upper O normal upper R right-parenthesis p 1 EndFraction 2nd Row 1st Column p 10 2nd Column equals p 1 3rd Row 1st Column p 20 2nd Column equals StartFraction normal upper O normal upper R Subscript 0 Baseline p 10 Over 1 minus p 10 plus left-parenthesis normal upper O normal upper R Subscript 0 Baseline right-parenthesis p 10 EndFraction 4th Row 1st Column p 0 2nd Column equals p 20 minus p 10 EndLayout

An input set consisting of RR, p 1, and normal upper R normal upper R Subscript 0 is transformed as follows:

StartLayout 1st Row 1st Column p 2 2nd Column equals left-parenthesis normal upper R normal upper R right-parenthesis p 1 2nd Row 1st Column p 10 2nd Column equals p 1 3rd Row 1st Column p 20 2nd Column equals left-parenthesis normal upper R normal upper R Subscript 0 Baseline right-parenthesis p 10 4th Row 1st Column p 0 2nd Column equals p 20 minus p 10 EndLayout

The transformation of either normal upper O normal upper R Subscript 0 or normal upper R normal upper R Subscript 0 to p 0 is not unique. The chosen parameterization fixes the null value p 10 at the input value of p 1. Some values of normal upper O normal upper R Subscript 0 or normal upper R normal upper R Subscript 0 might lead to invalid values of p 0 (p 0 less-than-or-equal-to 0 or p 0 greater-than-or-equal-to 1), in which case an "Invalid input" error occurs.

Farrington-Manning Score Test for Proportion Difference (TEST=FM)

The Farrington-Manning score test for proportion difference is based on equations (1), (2), and (12) in Farrington and Manning (1990). The test statistic, which is assumed to have a null distribution of upper N left-parenthesis 0 comma 1 right-parenthesis under upper H 0, is

z Subscript normal upper F normal upper M normal upper D Baseline equals StartFraction ModifyingAbove p 2 With caret minus ModifyingAbove p 1 With caret minus p 0 Over left-bracket StartFraction p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis Over n 1 EndFraction plus StartFraction p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis Over n 2 EndFraction right-bracket Superscript one-half Baseline EndFraction equals left-bracket upper N w 1 w 2 right-bracket Superscript one-half Baseline StartFraction ModifyingAbove p 2 With caret minus ModifyingAbove p 1 With caret minus p 0 Over left-bracket w 2 p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline EndFraction

where p 1 overTilde and p 2 overTilde are the maximum likelihood estimates of the proportions under the restriction p 2 overTilde minus p 1 overTilde equals p 0.

Sample size for the one-sided cases is given by equations (4) and (12) in Farrington and Manning (1990). One-sided power is computed by inverting the sample size formula. Power for the two-sided case is computed by adding the lower-sided and upper-sided powers, each evaluated at alpha slash 2. Sample size for the two-sided case is obtained by numerically inverting the power formula,

normal p normal o normal w normal e normal r equals StartLayout Enlarged left-brace 1st Row 1st Column normal upper Phi left-parenthesis StartFraction left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus alpha Baseline left-bracket w 2 p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column upper one hyphen sided 2nd Row 1st Column normal upper Phi left-parenthesis StartFraction minus left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus alpha Baseline left-bracket w 2 p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column lower one hyphen sided 3rd Row 1st Column normal upper Phi left-parenthesis StartFraction left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline left-bracket w 2 p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis plus 4th Row 1st Column normal upper Phi left-parenthesis StartFraction minus left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline left-bracket w 2 p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column two hyphen sided EndLayout

where

StartLayout 1st Row 1st Column p overTilde Subscript 2 2nd Column equals 3rd Column 2 u cosine left-parenthesis w right-parenthesis minus b slash left-parenthesis 3 a right-parenthesis 2nd Row 1st Column p overTilde Subscript 1 2nd Column equals 3rd Column p overTilde Subscript 2 Baseline minus p 0 3rd Row 1st Column w 2nd Column equals 3rd Column left-parenthesis pi plus cosine Superscript negative 1 Baseline left-parenthesis v slash u cubed right-parenthesis right-parenthesis slash 3 4th Row 1st Column v 2nd Column equals 3rd Column b cubed slash left-parenthesis 3 a right-parenthesis cubed minus b c slash left-parenthesis 6 a squared right-parenthesis plus d slash left-parenthesis 2 a right-parenthesis 5th Row 1st Column u 2nd Column equals 3rd Column normal s normal i normal g normal n left-parenthesis v right-parenthesis StartRoot b squared slash left-parenthesis 3 a right-parenthesis squared minus c slash left-parenthesis 3 a right-parenthesis EndRoot 6th Row 1st Column a 2nd Column equals 3rd Column 1 plus w 1 slash w 2 7th Row 1st Column b 2nd Column equals 3rd Column minus left-bracket 1 plus w 1 slash w 2 plus p 2 plus left-parenthesis w 1 slash w 2 right-parenthesis p 1 plus p 0 left-parenthesis w 1 slash w 2 plus 2 right-parenthesis right-bracket 8th Row 1st Column c 2nd Column equals 3rd Column p 0 squared plus p 0 left-parenthesis 2 p 2 plus w 1 slash w 2 plus 1 right-parenthesis plus p 2 plus left-parenthesis w 1 slash w 2 right-parenthesis p 1 9th Row 1st Column d 2nd Column equals 3rd Column minus p 2 p 0 left-parenthesis 1 plus p 0 right-parenthesis EndLayout

For the one-sided cases, a closed-form inversion of the power equation yields an approximate total sample size of

upper N equals StartFraction left-bracket z Subscript 1 minus alpha Baseline StartSet w 2 p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis EndSet Superscript one-half Baseline plus z Subscript normal p normal o normal w normal e normal r Baseline StartSet w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis EndSet Superscript one-half Baseline right-bracket squared Over w 1 w 2 left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis squared EndFraction

For the two-sided case, the solution for N is obtained by numerically inverting the power equation.

Farrington-Manning Score Test for Relative Risk (TEST=FM_RR)

The Farrington-Manning score test is based on equations (5), (6), and (13) in Farrington and Manning (1990). The test statistic, which is assumed to have a null distribution of upper N left-parenthesis 0 comma 1 right-parenthesis under upper H 0, is

z Subscript normal upper F normal upper M normal upper R Baseline equals StartFraction ModifyingAbove p 2 With caret minus normal upper R normal upper R Subscript 0 Baseline ModifyingAbove p 1 With caret Over left-bracket StartFraction normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis Over n 1 EndFraction plus StartFraction p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis Over n 2 EndFraction right-bracket Superscript one-half Baseline EndFraction equals left-bracket upper N w 1 w 2 right-bracket Superscript one-half Baseline StartFraction ModifyingAbove p 2 With caret minus normal upper R normal upper R Subscript 0 Baseline ModifyingAbove p 1 With caret Over left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline EndFraction

where p 1 overTilde and p 2 overTilde are the maximum likelihood estimates of the proportions under the restriction p 2 overTilde slash p 1 overTilde equals normal upper R normal upper R Subscript 0.

Sample size for the one-sided cases is given by equations (8) and (13) in Farrington and Manning (1990). One-sided power is computed by inverting the sample size formula. Power for the two-sided case is computed by adding the lower-sided and upper-sided powers, each evaluated at alpha slash 2. Sample size for the two-sided case is obtained by numerically inverting the power formula,

normal p normal o normal w normal e normal r equals StartLayout Enlarged left-brace 1st Row 1st Column normal upper Phi left-parenthesis StartFraction left-parenthesis p 2 overTilde minus normal upper R normal upper R Subscript 0 Baseline p 1 overTilde right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus alpha Baseline left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column upper one hyphen sided 2nd Row 1st Column normal upper Phi left-parenthesis StartFraction minus left-parenthesis p 2 overTilde minus normal upper R normal upper R Subscript 0 Baseline p 1 overTilde right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus alpha Baseline left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column lower one hyphen sided 3rd Row 1st Column normal upper Phi left-parenthesis StartFraction left-parenthesis p 2 overTilde minus normal upper R normal upper R Subscript 0 Baseline p 1 overTilde right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis plus 4th Row 1st Column normal upper Phi left-parenthesis StartFraction minus left-parenthesis p 2 overTilde minus normal upper R normal upper R Subscript 0 Baseline p 1 overTilde right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column two hyphen sided EndLayout

where

StartLayout 1st Row 1st Column p overTilde Subscript 2 2nd Column equals 3rd Column StartFraction negative b minus left-parenthesis b squared minus 4 a c right-parenthesis Superscript one-half Baseline Over 2 a EndFraction 2nd Row 1st Column p overTilde Subscript 1 2nd Column equals 3rd Column p overTilde Subscript 2 Baseline slash normal upper R normal upper R Subscript 0 3rd Row 1st Column a 2nd Column equals 3rd Column 1 plus w 1 slash w 2 4th Row 1st Column b 2nd Column equals 3rd Column minus left-bracket normal upper R normal upper R Subscript 0 Baseline left-parenthesis 1 plus left-parenthesis w 1 slash w 2 right-parenthesis p 1 right-parenthesis plus p 2 plus w 1 slash w 2 right-bracket 5th Row 1st Column c 2nd Column equals 3rd Column normal upper R normal upper R Subscript 0 Baseline left-parenthesis p 2 plus left-parenthesis w 1 slash w 2 right-parenthesis p 1 right-parenthesis EndLayout

For the one-sided cases, a closed-form inversion of the power equation yields an approximate total sample size of

upper N equals StartFraction left-bracket z Subscript 1 minus alpha Baseline StartSet w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 overTilde left-parenthesis 1 minus p 1 overTilde right-parenthesis plus w 1 p 2 overTilde left-parenthesis 1 minus p 2 overTilde right-parenthesis EndSet Superscript one-half Baseline plus z Subscript normal p normal o normal w normal e normal r Baseline StartSet w 2 normal upper R normal upper R Subscript 0 Superscript 2 Baseline p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis EndSet Superscript one-half Baseline right-bracket squared Over w 1 w 2 left-parenthesis p 2 minus normal upper R normal upper R Subscript 0 Baseline p 1 right-parenthesis squared EndFraction

For the two-sided case, the solution for N is obtained by numerically inverting the power equation.

Pearson Chi-Square Test for Two Proportions (TEST=PCHI)

The usual Pearson chi-square test is unconditional. The test statistic

z Subscript upper P Baseline equals StartFraction ModifyingAbove p 2 With caret minus ModifyingAbove p 1 With caret minus p 0 Over left-bracket ModifyingAbove p With caret left-parenthesis 1 minus ModifyingAbove p With caret right-parenthesis left-parenthesis StartFraction 1 Over n 1 EndFraction plus StartFraction 1 Over n 2 EndFraction right-parenthesis right-bracket Superscript one-half Baseline EndFraction equals left-bracket upper N w 1 w 2 right-bracket Superscript one-half Baseline StartFraction ModifyingAbove p 2 With caret minus ModifyingAbove p 1 With caret minus p 0 Over left-bracket ModifyingAbove p With caret left-parenthesis 1 minus ModifyingAbove p With caret right-parenthesis right-bracket Superscript one-half Baseline EndFraction

is assumed to have a null distribution of upper N left-parenthesis 0 comma 1 right-parenthesis.

Sample size for the one-sided cases is given by equation (4) in Fleiss, Tytun, and Ury (1980). One-sided power is computed as suggested by Diegert and Diegert (1981) by inverting the sample size formula. Power for the two-sided case is computed by adding the lower-sided and upper-sided powers each evaluated at alpha slash 2. Sample size for the two-sided case is obtained by numerically inverting the power formula. A custom null value p 0 for the proportion difference p 2 minus p 1 is also supported, but it is not recommended. If you are using a nondefault null value, then the Farrington-Manning score test is a better choice.

normal p normal o normal w normal e normal r equals StartLayout Enlarged left-brace 1st Row 1st Column normal upper Phi left-parenthesis StartFraction left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus alpha Baseline left-bracket left-parenthesis w 1 p 1 plus w 2 p 2 right-parenthesis left-parenthesis 1 minus w 1 p 1 minus w 2 p 2 right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column upper one hyphen sided 2nd Row 1st Column normal upper Phi left-parenthesis StartFraction minus left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus alpha Baseline left-bracket left-parenthesis w 1 p 1 plus w 2 p 2 right-parenthesis left-parenthesis 1 minus w 1 p 1 minus w 2 p 2 right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column lower one hyphen sided 3rd Row 1st Column normal upper Phi left-parenthesis StartFraction left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline left-bracket left-parenthesis w 1 p 1 plus w 2 p 2 right-parenthesis left-parenthesis 1 minus w 1 p 1 minus w 2 p 2 right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis plus 4th Row 1st Column normal upper Phi left-parenthesis StartFraction minus left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis left-parenthesis upper N w 1 w 2 right-parenthesis Superscript one-half Baseline minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline left-bracket left-parenthesis w 1 p 1 plus w 2 p 2 right-parenthesis left-parenthesis 1 minus w 1 p 1 minus w 2 p 2 right-parenthesis right-bracket Superscript one-half Baseline Over left-bracket w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis right-bracket Superscript one-half Baseline EndFraction right-parenthesis comma 2nd Column two hyphen sided EndLayout

For the one-sided cases, a closed-form inversion of the power equation yields an approximate total sample size

upper N equals StartFraction left-bracket z Subscript 1 minus alpha Baseline StartSet left-parenthesis w 1 p 1 plus w 2 p 2 right-parenthesis left-parenthesis 1 minus w 1 p 1 minus w 2 p 2 right-parenthesis EndSet Superscript one-half Baseline plus z Subscript normal p normal o normal w normal e normal r Baseline StartSet w 2 p 1 left-parenthesis 1 minus p 1 right-parenthesis plus w 1 p 2 left-parenthesis 1 minus p 2 right-parenthesis EndSet Superscript one-half Baseline right-bracket squared Over w 1 w 2 left-parenthesis p 2 minus p 1 minus p 0 right-parenthesis squared EndFraction

For the two-sided case, the solution for N is obtained by numerically inverting the power equation.

Likelihood Ratio Chi-Square Test for Two Proportions (TEST=LRCHI)

The usual likelihood ratio chi-square test is unconditional. The test statistic

z Subscript normal upper L normal upper R Baseline equals left-parenthesis minus 1 Subscript StartSet p 2 less-than p 1 EndSet Baseline right-parenthesis StartRoot 2 upper N sigma-summation Underscript i equals 1 Overscript 2 Endscripts left-bracket w Subscript i Baseline ModifyingAbove p Subscript i Baseline With caret log left-parenthesis StartFraction ModifyingAbove p Subscript i Baseline With caret Over ModifyingAbove p With caret EndFraction right-parenthesis plus w Subscript i Baseline left-parenthesis 1 minus ModifyingAbove p Subscript i Baseline With caret right-parenthesis log left-parenthesis StartFraction 1 minus ModifyingAbove p Subscript i Baseline With caret Over 1 minus ModifyingAbove p With caret EndFraction right-parenthesis right-bracket EndRoot

is assumed to have a null distribution of upper N left-parenthesis 0 comma 1 right-parenthesis and an alternative distribution of upper N left-parenthesis delta comma 1 right-parenthesis, where

delta equals upper N Superscript one-half Baseline left-parenthesis minus 1 Subscript StartSet p 2 less-than p 1 EndSet Baseline right-parenthesis StartRoot 2 sigma-summation Underscript i equals 1 Overscript 2 Endscripts left-bracket w Subscript i Baseline p Subscript i Baseline log left-parenthesis StartFraction p Subscript i Baseline Over w 1 p 1 plus w 2 p 2 EndFraction right-parenthesis plus w Subscript i Baseline left-parenthesis 1 minus p Subscript i Baseline right-parenthesis log left-parenthesis StartFraction 1 minus p Subscript i Baseline Over 1 minus left-parenthesis w 1 p 1 plus w 2 p 2 right-parenthesis EndFraction right-parenthesis right-bracket EndRoot

The approximate power is

normal p normal o normal w normal e normal r equals StartLayout Enlarged left-brace 1st Row 1st Column normal upper Phi left-parenthesis delta minus z Subscript 1 minus alpha Baseline right-parenthesis comma 2nd Column upper one hyphen sided 2nd Row 1st Column normal upper Phi left-parenthesis negative delta minus z Subscript 1 minus alpha Baseline right-parenthesis comma 2nd Column lower one hyphen sided 3rd Row 1st Column normal upper Phi left-parenthesis delta minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline right-parenthesis plus normal upper Phi left-parenthesis negative delta minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline right-parenthesis comma 2nd Column two hyphen sided EndLayout

For the one-sided cases, a closed-form inversion of the power equation yield an approximate total sample size

upper N equals left-parenthesis StartFraction z Subscript normal p normal o normal w normal e normal r Baseline plus z Subscript 1 minus alpha Baseline Over delta EndFraction right-parenthesis squared

For the two-sided case, the solution for N is obtained by numerically inverting the power equation.

Fisher’s Exact Conditional Test for Two Proportions (Test=FISHER)

Fisher’s exact test is conditional on the observed total number of successes m. Power and sample size computations are based on a test with similar power properties, the continuity-adjusted arcsine test. The test statistic

StartLayout 1st Row 1st Column z Subscript upper A 2nd Column equals left-parenthesis 4 upper N w 1 w 2 right-parenthesis Superscript one-half Baseline left-bracket normal a normal r normal c normal s normal i normal n left-parenthesis left-bracket ModifyingAbove p 2 With caret plus StartFraction 1 Over 2 upper N w 2 EndFraction left-parenthesis 1 Subscript StartSet ModifyingAbove p 2 With caret less-than ModifyingAbove p 1 With caret EndSet Baseline minus 1 Subscript StartSet ModifyingAbove p 2 With caret greater-than ModifyingAbove p 1 With caret EndSet Baseline right-parenthesis right-bracket Superscript one-half Baseline right-parenthesis 2nd Row 1st Column Blank 2nd Column minus normal a normal r normal c normal s normal i normal n left-parenthesis left-bracket ModifyingAbove p 1 With caret plus StartFraction 1 Over 2 upper N w 1 EndFraction left-parenthesis 1 Subscript StartSet ModifyingAbove p 1 With caret less-than ModifyingAbove p 2 With caret EndSet Baseline minus 1 Subscript StartSet ModifyingAbove p 1 With caret greater-than ModifyingAbove p 2 With caret EndSet Baseline right-parenthesis right-bracket Superscript one-half Baseline right-parenthesis right-bracket EndLayout

is assumed to have a null distribution of upper N left-parenthesis 0 comma 1 right-parenthesis and an alternative distribution of upper N left-parenthesis delta comma 1 right-parenthesis, where

StartLayout 1st Row 1st Column delta 2nd Column equals left-parenthesis 4 upper N w 1 w 2 right-parenthesis Superscript one-half Baseline left-bracket normal a normal r normal c normal s normal i normal n left-parenthesis left-bracket p 2 plus StartFraction 1 Over 2 upper N w 2 EndFraction left-parenthesis 1 Subscript StartSet p 2 less-than p 1 EndSet Baseline minus 1 Subscript StartSet p 2 greater-than p 1 EndSet Baseline right-parenthesis right-bracket Superscript one-half Baseline right-parenthesis 2nd Row 1st Column Blank 2nd Column minus normal a normal r normal c normal s normal i normal n left-parenthesis left-bracket p 1 plus StartFraction 1 Over 2 upper N w 1 EndFraction left-parenthesis 1 Subscript StartSet p 1 less-than p 2 EndSet Baseline minus 1 Subscript StartSet p 1 greater-than p 2 EndSet Baseline right-parenthesis right-bracket Superscript one-half Baseline right-parenthesis right-bracket EndLayout

The approximate power for the one-sided balanced case is given by Walters (1979) and is easily extended to the unbalanced and two-sided cases:

normal p normal o normal w normal e normal r equals StartLayout Enlarged left-brace 1st Row 1st Column normal upper Phi left-parenthesis delta minus z Subscript 1 minus alpha Baseline right-parenthesis comma 2nd Column upper one hyphen sided 2nd Row 1st Column normal upper Phi left-parenthesis negative delta minus z Subscript 1 minus alpha Baseline right-parenthesis comma 2nd Column lower one hyphen sided 3rd Row 1st Column normal upper Phi left-parenthesis delta minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline right-parenthesis plus normal upper Phi left-parenthesis negative delta minus z Subscript 1 minus StartFraction alpha Over 2 EndFraction Baseline right-parenthesis comma 2nd Column two hyphen sided EndLayout

The approximation is valid only for upper N greater-than-or-equal-to 1 slash left-parenthesis 2 w 1 w 2 StartAbsoluteValue p 1 minus p 2 EndAbsoluteValue right-parenthesis.

Last updated: December 09, 2022