ONESAMPLEFREQ
<options> ;
The ONESAMPLEFREQ statement performs power and sample size analyses for exact and approximate tests (including equivalence, noninferiority, and superiority) and confidence interval precision for a single binomial proportion.
Table 75.8 summarizes the options available in the ONESAMPLEFREQ statement.
Table 75.8: ONESAMPLEFREQ Statement Options
Option 
Description 

Define analysis 

Specifies an analysis of precision of a confidence interval 

Specifies the statistical analysis 

Specify analysis information 

Specifies the significance level 

Specifies the lower and upper equivalence bounds 

Specifies the lower equivalence bound 

Specifies the equivalence or noninferiority or superiority margin 

Specifies the null proportion 

Specifies the number of sides and the direction of the statistical test 

Specifies the upper equivalence bound 

Specify effect 

Specifies the desired confidence interval halfwidth 

Specifies the binomial proportion 

Specify variance estimation 

Specifies how the variance is computed 

Specify sample size 

Enables fractional input and output for sample sizes 

Specifies the sample size 

Specify power and related probabilities 

Specifies the desired power of the test 

Specifies the probability of obtaining a confidence interval halfwidth less than or equal to the value specified by HALFWIDTH= 

Choose computational method 

Specifies the computational method 

Control ordering in output 

Controls the output order of parameters 
Table 75.9 summarizes the valid result parameters for different analyses in the ONESAMPLEFREQ statement.
Table 75.9: Summary of Result Parameters in the ONESAMPLEFREQ Statement
Analyses 
Solve For 
Syntax 

CI=WILSON 
Prob(width) 

CI=AGRESTICOULL 
Prob(width) 

CI=JEFFREYS 
Prob(width) 

CI=EXACT 
Prob(width) 

CI=WALD 
Prob(width) 

CI=WALD_CORRECT 
Prob(width) 

Power 

Power 

Sample size 

Power 

Power 

Sample size 

TEST=EQUIV_EXACT 
Power 

Power 

Power 

Sample size 

TEST=EXACT 
Power 

Power 

Power 

Sample size 
This section summarizes the syntax for the common analyses supported in the ONESAMPLEFREQ statement.
The following statements demonstrate a power computation for the exact test of a binomial proportion. Defaults for the SIDES= and ALPHA= options specify a twosided test with a 0.05 significance level.
proc power; onesamplefreq test=exact nullproportion = 0.2 proportion = 0.3 ntotal = 100 power = .; run;
The following statements demonstrate a sample size computation for the z test of a binomial proportion. Defaults for the SIDES=, ALPHA=, and VAREST= options specify a twosided test with a 0.05 significance level that uses the null variance estimate.
proc power; onesamplefreq test=z method=normal nullproportion = 0.8 proportion = 0.85 sides = u ntotal = . power = .9; run;
The following statements demonstrate a sample size computation for the z test of a binomial proportion with a continuity adjustment. Defaults for the SIDES=, ALPHA=, and VAREST= options specify a twosided test with a 0.05 significance level that uses the null variance estimate.
proc power; onesamplefreq test=adjz method=normal nullproportion = 0.15 proportion = 0.1 sides = l ntotal = . power = .9; run;
You can specify equivalence bounds by using the EQUIVBOUNDS= option, as in the following statements:
proc power; onesamplefreq test=equiv_exact proportion = 0.35 equivbounds = (0.2 0.4) ntotal = 50 power = .; run;
You can also specify the combination of NULLPROPORTION= and MARGIN= options:
proc power; onesamplefreq test=equiv_exact proportion = 0.35 nullproportion = 0.3 margin = 0.1 ntotal = 50 power = .; run;
Finally, you can specify the combination of LOWER= and UPPER= options:
proc power; onesamplefreq test=equiv_exact proportion = 0.35 lower = 0.2 upper = 0.4 ntotal = 50 power = .; run;
Note that the three preceding analyses are identical.
A noninferiority test corresponds to an upper onesided test with a negativevalued margin, as demonstrated in the following statements:
proc power; onesamplefreq test=exact sides = U proportion = 0.15 nullproportion = 0.1 margin = 0.02 ntotal = 130 power = .; run;
A superiority test corresponds to an upper onesided test with a positivevalued margin, as demonstrated in the following statements:
proc power; onesamplefreq test=exact sides = U proportion = 0.15 nullproportion = 0.1 margin = 0.02 ntotal = 130 power = .; run;
The following statements performs a confidence interval precision analysis for the Wilson scorebased confidence interval for a binomial proportion. The default value of the ALPHA= option specifies a confidence level of 0.95.
proc power; onesamplefreq ci=wilson halfwidth = 0.1 proportion = 0.3 ntotal = 70 probwidth = .; run;
To specify the equivalence bounds for TEST=EQUIV_ADJZ, TEST=EQUIV_EXACT, and TEST=EQUIV_Z, use any of these three option sets:
lower and upper equivalence bounds, using the EQUIVBOUNDS= option
lower and upper equivalence bounds, using the LOWER= and UPPER= options
null proportion (NULLPROPORTION=) and margin (MARGIN=)