If you specify the BINOMIAL option in the TABLES statement, PROC FREQ computes the binomial proportion for oneway tables. By default, this is the proportion of observations in the first variable level that appears in the output. (You can use the LEVEL= option to specify a different level for the proportion.) The binomial proportion is computed as

where is the frequency of the first (or designated) level and n is the total frequency of the oneway table. The standard error of the binomial proportion is computed as

By default, PROC FREQ provides Wald and exact (ClopperPearson) confidence limits for the binomial proportion. If you do not specify any confidence limit requests with the CL= binomialoption, PROC FREQ computes Wald asymptotic confidence limits. You can also request AgrestiCoull, Jeffreys, and Wilson (score) confidence limits for the binomial proportion. For details about these binomial confidence limits, including comparisons of their performance, see Brown, Cai, and DasGupta (2001); Agresti and Coull (1998); Newcombe (1998b).
Wald asymptotic confidence limits are based on the normal approximation to the binomial distribution. PROC FREQ computes the Wald confidence limits for the binomial proportion as

where is the percentile of the standard normal distribution. The confidence level is determined by the ALPHA= option, which, by default, equals 0.05 and produces 95% confidence limits.
If you specify CL=WALD(CORRECT) or the CORRECT binomialoption, PROC FREQ includes a continuity correction of in the Wald asymptotic confidence limits. The purpose of this correction is to adjust for the difference between the normal approximation and the discrete binomial distribution. See Fleiss, Levin, and Paik (2003) for more information. The continuitycorrected Wald confidence limits for the binomial proportion are computed as

If you specify the CL=AGRESTICOULL binomialoption, PROC FREQ computes AgrestiCoull confidence limits for the binomial proportion as

where









The AgrestiCoull confidence interval has the same general form as the standard Wald interval but uses in place of . For , the value of is close to 2, and this interval is the “add 2 successes and 2 failures” adjusted Wald interval of Agresti and Coull (1998).
If you specify the CL=JEFFREYS binomialoption, PROC FREQ computes Jeffreys confidence limits for the binomial proportion as

where is the percentile of the beta distribution with shape parameters b and c. The lower confidence limit is set to 0 when , and the upper confidence limit is set to 1 when . This is an equaltailed interval based on the noninformative Jeffreys prior for a binomial proportion. See Brown, Cai, and DasGupta (2001) for details. See Berger (1985) for information about using beta priors for inference on the binomial proportion.
If you specify the CL=WILSON binomialoption, PROC FREQ computes Wilson confidence limits for the binomial proportion. These are also known as score confidence limits (Wilson, 1927). The confidence limits are based on inverting the normal test that uses the null proportion in the variance (the score test). Wilson confidence limits are the roots of

and are computed as

If you specify CL=WILSON(CORRECT) or the CORRECT binomialoption, PROC FREQ provides continuitycorrected Wilson confidence limits, which are computed as the roots of

The Wilson interval has been shown to have better performance than the Wald interval and the exact (ClopperPearson) interval. For more information, see Agresti and Coull (1998); Brown, Cai, and DasGupta (2001); Newcombe (1998b).
Exact (ClopperPearson) confidence limits for the binomial proportion are constructed by inverting the equaltailed test based on the binomial distribution. This method is attributed to Clopper and Pearson (1934). The exact confidence limits and satisfy the following equations, for :






The lower confidence limit equals 0 when , and the upper confidence limit equals 1 when .
PROC FREQ computes the exact (ClopperPearson) confidence limits by using the F distribution as






where is the percentile of the F distribution with b and c degrees of freedom. See Leemis and Trivedi (1996) for a derivation of this expression. Also see Collett (1991) for more information about exact binomial confidence limits.
Because this is a discrete problem, the confidence coefficient (coverage probability) of the exact (ClopperPearson) interval is not exactly but is at least . Thus, this confidence interval is conservative. Unless the sample size is large, the actual coverage probability can be much larger than the target value. For more information about the performance of these confidence limits, see Agresti and Coull (1998); Brown, Cai, and DasGupta (2001); Leemis and Trivedi (1996).
The BINOMIAL option provides an asymptotic equality test for the binomial proportion by default. You can also specify binomialoptions to request tests of noninferiority, superiority, and equivalence for the binomial proportion. If you specify the BINOMIAL option in the EXACT statement, PROC FREQ also computes exact pvalues for the tests that you request with the binomialoptions.
PROC FREQ computes an asymptotic test of the hypothesis that the binomial proportion equals , where you can specify the value of with the P= binomialoption. If you do not specify a null value with P=, PROC FREQ uses by default. The binomial test statistic is computed as

By default, the standard error is based on the null hypothesis proportion as

If you specify the VAR=SAMPLE binomialoption, the standard error is computed from the sample proportion as

If you specify the CORRECT binomialoption, PROC FREQ includes a continuity correction in the asymptotic test statistic, towards adjusting for the difference between the normal approximation and the discrete binomial distribution. See Fleiss, Levin, and Paik (2003) for details. The continuity correction of is subtracted from the numerator of the test statistic if is positive; otherwise, the continuity correction is added to the numerator.
PROC FREQ computes onesided and twosided pvalues for this test. When the test statistic z is greater than zero (its expected value under the null hypothesis), PROC FREQ computes the rightsided pvalue, which is the probability of a larger value of the statistic occurring under the null hypothesis. A small rightsided pvalue supports the alternative hypothesis that the true value of the proportion is greater than . When the test statistic is less than or equal to zero, PROC FREQ computes the leftsided pvalue, which is the probability of a smaller value of the statistic occurring under the null hypothesis. A small leftsided pvalue supports the alternative hypothesis that the true value of the proportion is less than . The onesided pvalue can be expressed as

where Z has a standard normal distribution. The twosided pvalue is computed as .
If you specify the BINOMIAL option in the EXACT statement, PROC FREQ also computes an exact test of the null hypothesis . To compute the exact test, PROC FREQ uses the binomial probability function,

where the variable X has a binomial distribution with parameters n and . To compute the leftsided pvalue, , PROC FREQ sums the binomial probabilities over x from zero to . To compute the rightsided pvalue, , PROC FREQ sums the binomial probabilities over x from to n. The exact onesided pvalue is the minimum of the leftsided and rightsided pvalues,

and the exact twosided pvalue is computed as .
If you specify the NONINF binomialoption, PROC FREQ provides a noninferiority test for the binomial proportion. The null hypothesis for the noninferiority test is

versus the alternative

where is the noninferiority margin and is the null proportion. Rejection of the null hypothesis indicates that the binomial proportion is not inferior to the null value. See Chow, Shao, and Wang (2003) for more information.
You can specify the value of with the MARGIN= binomialoption, and you can specify with the P= binomialoption. By default, and .
PROC FREQ provides an asymptotic Wald test for noninferiority. The test statistic is computed as

where is the noninferiority limit,

By default, the standard error is computed from the sample proportion as

If you specify the VAR=NULL binomialoption, the standard error is based on the noninferiority limit (determined by the null proportion and the margin) as

If you specify the CORRECT binomialoption, PROC FREQ includes a continuity correction in the asymptotic test statistic z. The continuity correction of is subtracted from the numerator of the test statistic if is positive; otherwise, the continuity correction is added to the numerator.
The pvalue for the noninferiority test is

where Z has a standard normal distribution.
As part of the noninferiority analysis, PROC FREQ provides asymptotic Wald confidence limits for the binomial proportion. These confidence limits are computed as described in the section Wald Confidence Limits but use the same standard error (VAR=NULL or VAR=SAMPLE) as the noninferiority test statistic z. The confidence coefficient is % (Schuirmann, 1999). By default, if you do not specify the ALPHA= option, the noninferiority confidence limits are 90% confidence limits. You can compare the confidence limits to the noninferiority limit, .
If you specify the BINOMIAL option in the EXACT statement, PROC FREQ provides an exact noninferiority test for the binomial proportion. The exact pvalue is computed by using the binomial probability function with parameters and n,

See Chow, Shao, and Wang (2003, p. 116) for details. If you request exact binomial statistics, PROC FREQ also includes exact (ClopperPearson) confidence limits for the binomial proportion in the equivalence analysis display. See the section Exact (ClopperPearson) Confidence Limits for details.
If you specify the SUP binomialoption, PROC FREQ provides a superiority test for the binomial proportion. The null hypothesis for the superiority test is

versus the alternative

where is the superiority margin and is the null proportion. Rejection of the null hypothesis indicates that the binomial proportion is superior to the null value. You can specify the value of with the MARGIN= binomialoption, and you can specify the value of with the P= binomialoption. By default, and .
The superiority analysis is identical to the noninferiority analysis but uses a positive value of the margin in the null hypothesis. The superiority limit equals . The superiority computations follow those in the section Noninferiority Test but replace – with . See Chow, Shao, and Wang (2003) for more information.
If you specify the EQUIV binomialoption, PROC FREQ provides an equivalence test for the binomial proportion. The null hypothesis for the equivalence test is

versus the alternative

where is the lower margin, is the upper margin, and is the null proportion. Rejection of the null hypothesis indicates that the binomial proportion is equivalent to the null value. See Chow, Shao, and Wang (2003) for more information.
You can specify the value of the margins and with the MARGIN= binomialoption. If you do not specify MARGIN=, PROC FREQ uses lower and upper margins of –0.2 and 0.2 by default. If you specify a single margin value , PROC FREQ uses lower and upper margins of – and . You can specify the null proportion with the P= binomialoption. By default, .
PROC FREQ computes two onesided tests (TOST) for equivalence analysis (Schuirmann, 1987). The TOST approach includes a rightsided test for the lower margin and a leftsided test for the upper margin. The overall pvalue is taken to be the larger of the two pvalues from the lower and upper tests.
For the lower margin, the asymptotic Wald test statistic is computed as

where the lower equivalence limit is

By default, the standard error is computed from the sample proportion as

If you specify the VAR=NULL binomialoption, the standard error is based on the lower equivalence limit (determined by the null proportion and the lower margin) as

If you specify the CORRECT binomialoption, PROC FREQ includes a continuity correction in the asymptotic test statistic . The continuity correction of is subtracted from the numerator of the test statistic if the numerator is positive; otherwise, the continuity correction is added to the numerator.
The pvalue for the lower margin test is

The asymptotic test for the upper margin is computed similarly. The Wald test statistic is

where the upper equivalence limit is

By default, the standard error is computed from the sample proportion. If you specify the VAR=NULL binomialoption, the standard error is based on the upper equivalence limit as

If you specify the CORRECT binomialoption, PROC FREQ includes a continuity correction of in the asymptotic test statistic .
The pvalue for the upper margin test is

Based on the two onesided tests (TOST), the overall pvalue for the test of equivalence equals the larger pvalue from the lower and upper margin tests, which can be expressed as

As part of the equivalence analysis, PROC FREQ provides asymptotic Wald confidence limits for the binomial proportion. These confidence limits are computed as described in the section Wald Confidence Limits, but use the same standard error (VAR=NULL or VAR=SAMPLE) as the equivalence test statistics and have a confidence coefficient of % (Schuirmann, 1999). By default, if you do not specify the ALPHA= option, the equivalence confidence limits are 90% limits. If you specify VAR=NULL, separate standard errors are computed for the lower and upper margin tests, each based on the null proportion and the corresponding (lower or upper) margin. The confidence limits are computed by using the maximum of these two standard errors. You can compare the confidence limits to the equivalence limits, .
If you specify the BINOMIAL option in the EXACT statement, PROC FREQ also provides an exact equivalence test by using two onesided exact tests (TOST). The procedure computes lower and upper margin exact tests by using the binomial probability function as described in the section Noninferiority Test. The overall exact pvalue for the equivalence test is taken to be the larger pvalue from the lower and upper margin exact tests. If you request exact statistics, PROC FREQ also includes exact (ClopperPearson) confidence limits in the equivalence analysis display. The confidence coefficient is % (Schuirmann, 1999). See the section Exact (ClopperPearson) Confidence Limits for details.