Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
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.
\hat{p}  =  n_{1}  /  n
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
se(\hat{p})  =  
 \sqrt{ \hat{p} (1 - \hat{p} ) / n }

Using the normal approximation to the binomial distribution, PROC FREQ constructs asymptotic confidence limits for p according to

\hat{p}  +-  z_{\alpha/2} 
  \cdot  se(\hat{p})
where z_{\alpha/2} is the 100(1 - \alpha/2) percentile of the standard normal distribution. The confidence level \alpha 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

z  =  \frac{ \hat{p} - p_0 }{\sqrt{p_0 (1-p_0)/n}}
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
 
P_{1} = {\rm Prob} (Z \gt z) 
 {\rm if} z \gt 0
P_{1} = {\rm Prob} (Z \lt z) 
 {\rm if} z \leq 0
where Z has a standard normal distribution. The two-sided p-value P2 is computed as
P_{2} = {\rm Prob}
 (| Z| \gt | z|)

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

{\rm Prob}  (X = x  |  p_0 )  = 
 ( n \ x ) 
 p_0^x  (1-p_0)^{(n-x)} x = 0,1,2,  ...  ,n
where the variable X has a binomial distribution with parameters n and p0. To compute {\rm Prob} (X \leq n_1), PROC FREQ sums these binomial probabilities over x from zero to n1. To compute {\rm Prob} (X \geq n_1),PROC FREQ sums these binomial probabilities over x from n1 to n. Then the exact one-sided p-value is
P_{1} = {\rm min} ( 
 {\rm Prob}(X \leq n_1  |  p_0 ), 
 {\rm Prob}(X \geq n_1  |  p_0 )  )
and the exact two-sided p-value is

P_{2} = 2 \cdot P_{1}

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.