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 13 summarizes the options available in the ONESAMPLEFREQ statement.
Table 13: ONESAMPLEFREQ Statement Options
| Option | Description |
|---|---|
| Define Analysis | |
| CI= | Specifies an analysis of precision of a confidence interval |
| TEST= | Specifies the statistical analysis |
| Specify Analysis Information | |
| ALPHA= | Specifies the significance level |
| EQUIVBOUNDS= | Specifies the lower and upper equivalence bounds |
| LOWER= | Specifies the lower equivalence bound |
| MARGIN= | Specifies the equivalence or noninferiority or superiority margin |
| NULLPROPORTION= | Specifies the null proportion |
| SIDES= | Specifies the number of sides and the direction of the statistical test |
| UPPER= | Specifies the upper equivalence bound |
| Specify Effect | |
| HALFWIDTH= | Specifies the desired confidence interval half-width |
| PROPORTION= | Specifies the binomial proportion |
| Specify Variance Estimation | |
| VAREST= | Specifies how the variance is computed |
| Specify Sample Size | |
| NFRACTIONAL | Enables fractional input and output for sample sizes |
| NTOTAL= | Specifies the sample size |
| Specify Power and Related Probabilities | |
| POWER= | Specifies the desired power of the test |
| PROBWIDTH= | Specifies the probability of obtaining a confidence interval half-width less than or equal to the value specified by HALFWIDTH= |
| Choose Computational Method | |
| METHOD= | Specifies the computational method |
| Control Ordering in Output | |
| OUTPUTORDER= | Controls the output order of parameters |
Table 14 summarizes the valid result parameters for different analyses in the ONESAMPLEFREQ statement.
Table 14: Summary of Result Parameters in the ONESAMPLEFREQ Statement
| Analyses | Solve For | Syntax |
|---|---|---|
| CI=WILSON | Prob(width) | PROBWIDTH=. |
| CI=AGRESTICOULL | Prob(width) | PROBWIDTH=. |
| CI=JEFFREYS | Prob(width) | PROBWIDTH=. |
| CI=EXACT | Prob(width) | PROBWIDTH=. |
| CI=WALD | Prob(width) | PROBWIDTH=. |
| CI=WALD_CORRECT | Prob(width) | PROBWIDTH=. |
| TEST=ADJZ METHOD=EXACT | Power | POWER=. |
| TEST=ADJZ METHOD=NORMAL | Power | POWER=. |
| Sample size | NTOTAL=. | |
| TEST=EQUIV_ADJZ METHOD=EXACT | Power | POWER=. |
| TEST=EQUIV_ADJZ METHOD=NORMAL | Power | POWER=. |
| Sample size | NTOTAL=. | |
| TEST=EQUIV_EXACT | Power | POWER=. |
| TEST=EQUIV_Z METHOD=EXACT | Power | POWER=. |
| TEST=EQUIV_Z METHOD=NORMAL | Power | POWER=. |
| Sample size | NTOTAL=. | |
| TEST=EXACT | Power | POWER=. |
| TEST=Z METHOD=EXACT | Power | POWER=. |
| TEST=Z METHOD=NORMAL | Power | POWER=. |
| Sample size | NTOTAL=. |
This section summarizes the syntax for the common analyses that are 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 two-sided 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 two-sided 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 two-sided 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 = 500
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 = 500
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 = 500
power = .;
run;
Note that the three preceding analyses are identical.
A noninferiority test corresponds to an upper one-sided test with a negative-valued 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 one-sided test with a positive-valued 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 score-based 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=)