The FREQ Procedure

### Binomial Proportion

When you specify the BINOMIAL option in the TABLES statement, PROC FREQ computes a binomial proportion for one-way tables. This is the proportion of observations in the first variable level, or class, that appears in the output. where n1 is the frequency for the first level and n is the total frequency for the one-way table. The standard error for the binomial proportion is computed as Using the normal approximation to the binomial distribution, PROC FREQ constructs asymptotic confidence limits for p according to 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. Additionally, PROC FREQ computes exact confidence limits for the binomial proportion using the F distribution method given in Collett (1991) and also described by Leemis and Trivedi (1996).

PROC FREQ computes an asymptotic test of the hypothesis that the binomial proportion equals p0, where the value of p0 is specified by the P= option in the TABLES statement. If you do not specify a value for the P= option, PROC FREQ uses p0 = 0.5 by default. The asymptotic test statistic is PROC FREQ computes one-sided and two-sided p-values for this test. When the test statistic z is greater than zero, its expected value under the null hypothesis, PROC FREQ computes the right-sided p-value, which is the probability of a larger value of the statistic occurring under the null hypothesis. A small right-sided p-value supports the alternative hypothesis that the true value of the proportion is greater than p0. When the test statistic is less than or equal to zero, PROC FREQ computes the left-sided p-value, which is the probability of a smaller value of the statistic occurring under the null hypothesis. A small left-sided p-value supports the alternative hypothesis that the true value of the proportion is less than p0. The one-sided p-value P1 can be expressed as  where Z has a standard normal distribution. The two-sided p-value P2 is computed as When you specify the BINOMIAL option in the EXACT statement, PROC FREQ also computes an exact test of the null hypothesis H0: p = p0. To compute this exact test, PROC FREQ uses the binomial probability function where the variable X has a binomial distribution with parameters n and p0. To compute , PROC FREQ sums these binomial probabilities over x from zero to n1. To compute ,PROC FREQ sums these binomial probabilities over x from n1 to n. Then the exact one-sided p-value is and the exact two-sided p-value is 