# The POWER Procedure

### TWOSAMPLEFREQ Statement

Subsections:

• TWOSAMPLEFREQ <options>;

The TWOSAMPLEFREQ statement performs power and sample size analyses for tests of two independent proportions. The Farrington-Manning score, Pearson’s chi-square, Fisher’s exact, and likelihood ratio chi-square tests are supported.

#### Summary of Options

Table 89.21 summarizes the options available in the TWOSAMPLEFREQ statement.

Table 89.21: TWOSAMPLEFREQ Statement Options

Option

Description

Define analysis

Specifies the statistical analysis

Specify analysis information

Specifies the significance level

Specifies the null odds ratio

Specifies the null proportion difference

Specifies the null relative risk

Specifies the number of sides and the direction of the statistical test or confidence interval

Specify effects

Specifies the two independent proportions, and

Specifies the odds ratio

Specifies the proportion difference

Specifies the reference proportion

Specifies the relative risk

Specify sample size and allocation

Specifies the two group sample sizes

Specifies the sample size allocation weights for the two groups

Enables fractional input and output for sample sizes

Specifies the common sample size per group

Specifies the sample size

Specify power

Specifies the desired power of the test

Control ordering in output

Controls the output order of parameters

Table 89.22 summarizes the valid result parameters for different analyses in the TWOSAMPLEFREQ statement.

Table 89.22: Summary of Result Parameters in the TWOSAMPLEFREQ Statement

Analyses

Solve For

Syntax

TEST= FISHER

Power

Sample size

TEST= FM

Power

Sample size

TEST= FM_RR

Power

Sample size

TEST= LRCHI

Power

Sample size

TEST= PCHI

Power

Sample size

#### Dictionary of Options

ALPHA=number-list

specifies the level of significance of the statistical test. The default is 0.05, which corresponds to the usual 0.05 100% = 5% level of significance. For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

GROUPPROPORTIONS=grouped-number-list
GPROPORTIONS=grouped-number-list
GROUPPS=grouped-number-list
GPS=grouped-number-list

specifies the two independent proportions, and . For information about specifying the grouped-number-list, see the section Specifying Value Lists in Analysis Statements.

GROUPNS=grouped-number-list
GNS=grouped-number-list

specifies the two group sample sizes. For information about specifying the grouped-number-list, see the section Specifying Value Lists in Analysis Statements.

GROUPWEIGHTS=grouped-number-list
GWEIGHTS=grouped-number-list

specifies the sample size allocation weights for the two groups. This option controls how the total sample size is divided between the two groups. Each pair of values for the two groups represents relative allocation weights. Additionally, if the NFRACTIONAL option is not used, the total sample size is restricted to be equal to a multiple of the sum of the two group weights (so that the resulting design has an integer sample size for each group while adhering exactly to the group allocation weights). Values must be integers unless the NFRACTIONAL option is used. The default value is (1 1), a balanced design with a weight of 1 for each group. For information about specifying the grouped-number-list, see the section Specifying Value Lists in Analysis Statements.

NFRACTIONAL
NFRAC

enables fractional input and output for sample sizes. See the section Sample Size Adjustment Options for information about the ramifications of the presence (and absence) of the NFRACTIONAL option.

NPERGROUP=number-list
NPERG=number-list

specifies the common sample size per group or requests a solution for the common sample size per group by specifying a missing value (NPERGROUP= .). Use of this option implicitly specifies a balanced design. For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

NTOTAL=number-list

specifies the sample size or requests a solution for the sample size by specifying a missing value (NTOTAL= .). For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

NULLODDSRATIO=number-list
NULLOR=number-list

specifies the null odds ratio. You can specify this option only if you also specify the ODDSRATIO= and TEST= PCHI options. The NULLODDSRATIO= option is inconsistent with TEST= PCHI, which tests the proportion difference rather than the odds ratio, and its value is converted internally to a NULLPROPORTIONDIFF value by fixing the reference proportion. For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements. By default, NULLOR=1.

NULLPROPORTIONDIFF=number-list
NULLPDIFF=number-list

specifies the null proportion difference. You can specify this option only if you also specify the GROUPPROPORTIONS= or PROPORTIONDIFF= option and the TEST= FM or TEST= PCHI option. If you are using a nondefault null value, then TEST= FM is recommended. For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements. By default, NULLPDIFF=0.

NULLRELATIVERISK=number-list
NULLRR=number-list

specifies the null relative risk. You can specify this option only if you also specify the GROUPPROPORTIONS= or RELATIVERISK= option and the TEST= FM_RR or TEST= PCHI option. If you are using a nondefault null value, then TEST= FM_RR is recommended. The NULLRELATIVERISK= option is inconsistent with TEST= PCHI, which tests the proportion difference rather than the relative risk, and its value is converted internally to a NULLPROPORTIONDIFF value by fixing the reference proportion. For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements. By default, NULLRR=1.

ODDSRATIO=number-list
OR=number-list

specifies the odds ratio . For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

OUTPUTORDER=INTERNAL | REVERSE | SYNTAX

controls how the input and default analysis parameters are ordered in the output. OUTPUTORDER= INTERNAL (the default) arranges the parameters in the output according to the following order of their corresponding options:

The OUTPUTORDER= SYNTAX option arranges the parameters in the output in the same order in which their corresponding options are specified in the TWOSAMPLEFREQ statement. The OUTPUTORDER= REVERSE option arranges the parameters in the output in the reverse of the order in which their corresponding options are specified in the TWOSAMPLEFREQ statement.

POWER=number-list

specifies the desired power of the test or requests a solution for the power by specifying a missing value (POWER= .). The power is expressed as a probability, a number between 0 and 1, rather than as a percentage. For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

PROPORTIONDIFF=number-list
PDIFF=number-list

specifies the proportion difference . For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

REFPROPORTION=number-list
REFP=number-list

specifies the reference proportion . For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

RELATIVERISK=number-list
RR=number-list

specifies the relative risk . For information about specifying the number-list, see the section Specifying Value Lists in Analysis Statements.

SIDES=keyword-list

specifies the number of sides (or tails) and the direction of the statistical test or confidence interval. For information about specifying the keyword-list, see the section Specifying Value Lists in Analysis Statements. You can specify the following keywords:

1

specifies a one-sided test, with the alternative hypothesis in the same direction as the effect.

2

specifies a two-sided test.

U

specifies an upper one-sided test, with the alternative hypothesis indicating an effect greater than the null value.

L

specifies a lower one-sided test, with the alternative hypothesis indicating an effect less than the null value.

If the effect size is zero, then SIDES= 1 is not permitted; instead, specify the direction of the test explicitly in this case with either SIDES= L or SIDES= U. By default, SIDES=2.

TEST=FISHER | FM | FM_RR | LRCHI | PCHI

specifies the statistical analysis. You can specify the following values:

FISHER

specifies Fisher’s exact test.

FM

specifies the score test of Farrington and Manning (1990) for proportion difference.

FM_RR

specifies the score test of Farrington and Manning (1990) for relative risk.

LRCHI

specifies the likelihood ratio chi-square test.

PCHI

specifies Pearson’s chi-square test for proportion difference.

If you are using a nondefault null value for a noninferiority or superiority test, then TEST= FM or TEST= FM_RR is the most appropriate choice. In the absence of any nondefault null values, the default is TEST=PCHI. If you specify at least one nonzero null difference by using the NULLPROPORTIONDIFF= option, then the default is TEST=FM. If you specify at least one null relative risk not equal to 1 by using the NULLRR= option, then the default is TEST=FM_RR. For information about the power and sample size computational methods and formulas, see the section Analyses in the TWOSAMPLEFREQ Statement.

#### Restrictions on Option Combinations

To specify the proportions, choose one of the following parameterizations:

To specify the sample size and allocation, choose one of the following parameterizations:

• sample size per group in a balanced design (by using the NPERGROUP= option)

• total sample size and allocation weights (by using the NTOTAL= and GROUPWEIGHTS= options)

• individual group sample sizes (by using the GROUPNS= option)

#### Option Groups for Common Analyses

This section summarizes the syntax for the common analyses that are supported in the TWOSAMPLEFREQ statement.

##### Pearson Chi-Square Test for Two Proportions

You can use the NPERGROUP= option in a balanced design and express effects in terms of the individual proportions, as in the following statements. Default values for the SIDES= and ALPHA= options specify a two-sided test with a significance level of 0.05.

proc power;
twosamplefreq test=pchi
groupproportions = (.15 .25)
nullproportiondiff = .03
npergroup = 50
power = .;
run;


You can also specify an unbalanced design by using the NTOTAL= and GROUPWEIGHTS= options and express effects in terms of the odds ratio. The default value of the NULLODDSRATIO= option specifies a test of no effect.

proc power;
twosamplefreq test=pchi
oddsratio = 2.5
refproportion = 0.3
groupweights = (1 2)
ntotal = .
power = 0.8;
run;


You can also specify sample sizes with the GROUPNS= option and express effects in terms of relative risks. The default value of the NULLRELATIVERISK= option specifies a test of no effect.

proc power;
twosamplefreq test=pchi
relativerisk = 1.5
refproportion = 0.2
groupns = 40 | 60
power = .;
run;


You can also express effects in terms of the proportion difference. The default value of the NULLPROPORTIONDIFF= option specifies a test of no effect, and the default value of the GROUPWEIGHTS= option specifies a balanced design.

proc power;
twosamplefreq test=pchi
proportiondiff = 0.15
refproportion = 0.4
ntotal = 100
power = .;
run;

##### Farrington-Manning Score Test for Proportion Difference

The following statements demonstrate a sample size computation for the Farrington-Manning score test for the difference of two independent proportions:

proc power;
twosamplefreq test=fm
proportiondiff = 0.06
refproportion = 0.32
nullproportiondiff = -0.02
sides = u
ntotal = .
power = 0.85;
run;

##### Farrington-Manning Score Test for Relative Risk

The following statements demonstrate a sample size computation for the Farrington-Manning score test for the relative risk of two independent proportions:

proc power;
twosamplefreq test=fm_rr
relativerisk = 1.1
refproportion = 0.32
nullrelativerisk = 0.95
sides = u
ntotal = .
power = 0.9;
run;

##### Fisher’s Exact Conditional Test for Two Proportions

The following statements demonstrate a power computation for Fisher’s exact conditional test for two proportions. Default values for the SIDES= and ALPHA= options specify a two-sided test with a significance level of 0.05.

proc power;
twosamplefreq test=fisher
groupproportions = (.35 .15)
npergroup = 50
power = .;
run;

##### Likelihood Ratio Chi-Square Test for Two Proportions

The following statements demonstrate a sample size computation for the likelihood ratio chi-square test for two proportions. Default values for the SIDES= and ALPHA= options specify a two-sided test with a significance level of 0.05.

proc power;
twosamplefreq test=lrchi
oddsratio = 2
refproportion = 0.4
npergroup = .
power = 0.9;
run;