TWOSAMPLEFREQ
<options> ;
The TWOSAMPLEFREQ statement performs power and sample size analyses for tests of two independent proportions. Pearson’s chisquare, Fisher’s exact, and likelihood ratio chisquare tests are supported.
Table 71.19 summarizes the options available in the TWOSAMPLEFREQ statement.
Table 71.19: 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 71.20 summarizes the valid result parameters for different analyses in the TWOSAMPLEFREQ statement.
Table 71.20: Summary of Result Parameters in the TWOSAMPLEFREQ Statement
To specify the proportions, choose one of the following parameterizations:
individual proportions (by using the GROUPPROPORTIONS= option)
difference between proportions and reference proportion (by using the PROPORTIONDIFF= and REFPROPORTION= options)
odds ratio and reference proportion (by using the ODDSRATIO= and REFPROPORTION= options)
relative risk and reference proportion (by using the RELATIVERISK= and REFPROPORTION= options)
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)
This section summarizes the syntax for the common analyses supported in the TWOSAMPLEFREQ statement.
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 twosided 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;
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 twosided test with a significance level of 0.05.
proc power; twosamplefreq test=fisher groupproportions = (.35 .15) npergroup = 50 power = .; run;
The following statements demonstrate a sample size computation for the likelihood ratio chisquare test for two proportions. Default values for the SIDES= and ALPHA= options specify a twosided test with a significance level of 0.05.
proc power; twosamplefreq test=lrchi oddsratio = 2 refproportion = 0.4 npergroup = . power = 0.9; run;