The FREQ Procedure

Example 3: Computing Binomial Proportions for One-Way Frequency Tables

Procedure features:
PROC FREQ statement option:
 ORDER=
TABLES statement options:
 ALPHA= BINOMIAL
WEIGHT statement
Data set: COLOR

This example

• creates a one-way frequency tables using existing cell counts

• orders the values of the frequency table by their frequency in the input data set

• computes the binomial proportion and the corresponding test statistic

• specifies the null hypothesis proportion for the asymptotic test of the binomial proportion

• specifies the confidence level for the confidence limits.

`options nodate pageno=1 linesize=80 pagesize=40;`

 ```proc freq data=color order=freq; weight count;```
 ` tables eyes/binomial alpha=.1;`
 ` tables hair/binomial(p=.28);`
 ``` title 'Hair and Eye Color of European Children'; run;```

 The frequency table lists the variable values in the order of the descending frequency count. PROC FREQ computes the binomial proportion for the first variable level. The report includes the asymptotic standard error (ASE), and asymptotic and exact confidence limits for the binomial proportion. The specified confidence level of .1 results in 90 percent confidence limits. Because the value of Z is less than zero for eye color, PROC FREQ computes a left-sided p-value. The small p-value supports the alternative hypothesis that the true value of the proportion of children with brown eyes is less than 50 percent. Because the value of Z is greater than zero for hair color, PROC FREQ computes a right-sided p-value. The large p-value provides insufficient evidence to reject the null hypothesis that the proportion of children with fair hair equals 28 percent.