Chapter Contents Previous Next
 The FREQ Procedure

## Example 28.3: Computing Binomial Proportions for One-Way Frequency Tables

The binomial proportion is computed as the proportion of observations for the first level of the variable that you are studying. The following statements compute the proportion of children with brown eyes (from the data set in Example 28.1) and test this value against the hypothesis that the proportion is 50%. Also, these statements test whether the proportion of children with fair hair is 28%.

```   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 first TABLES statement produces a frequency table for eye color. The BINOMIAL option computes the binomial proportion and confidence limits, and it tests the hypothesis that the proportion for the first eye color level (brown) is 0.5. The option ALPHA=.1 specifies that 90% confidence limits should be computed. The second TABLES statement creates a frequency table for hair color and computes the binomial proportion and confidence limits, but it tests that the proportion for the first hair color (fair) is 0.28. These statements produce Output 28.3.1 and Output 28.3.2.

Output 28.3.1: Binomial Proportion for Eye Color

 Hair and Eye Color of European Children
 The FREQ Procedure
 Eye Color Eyes Frequency Percent Cumulative Frequency Cumulative Percent brown 341 44.75 341 44.75 blue 222 29.13 563 73.88 green 199 26.12 762 100.00

 Binomial Proportion for Eyes = brown Proportion 0.4475 ASE 0.0180 90% Lower Conf Limit 0.4179 90% Upper Conf Limit 0.4771 Exact Conf Limits 90% Lower Conf Limit 0.4174 90% Upper Conf Limit 0.4779

 Test of H0: Proportion = 0.5 ASE under H0 0.0181 Z -2.8981 One-sided Pr < Z 0.0019 Two-sided Pr > |Z| 0.0038

The frequency table in Output 28.3.1 displays the variable values in order of descending frequency count. Since the first variable level is 'brown', PROC FREQ computes the binomial proportion of children with brown eyes. PROC FREQ also computes its asymptotic standard error (ASE), and asymptotic and exact 90% confidence limits. If you do not specify the ALPHA= option, then PROC FREQ computes the default 95% confidence limits.

Because the value of Z is less than zero, PROC FREQ computes a left-sided p-value (0.0019). This small p-value supports the alternative hypothesis that the true value of the proportion of children with brown eyes is less than 50%.

Output 28.3.2: Binomial Proportion for Hair Color

 Hair and Eye Color of European Children
 The FREQ Procedure
 Hair Color Hair Frequency Percent Cumulative Frequency Cumulative Percent fair 228 29.92 228 29.92 medium 217 28.48 445 58.40 dark 182 23.88 627 82.28 red 113 14.83 740 97.11 black 22 2.89 762 100.00

 Binomial Proportion for Hair = fair Proportion 0.2992 ASE 0.0166 95% Lower Conf Limit 0.2667 95% Upper Conf Limit 0.3317 Exact Conf Limits 95% Lower Conf Limit 0.2669 95% Upper Conf Limit 0.3331

 Test of H0: Proportion = 0.28 ASE under H0 0.0163 Z 1.1812 One-sided Pr > Z 0.1188 Two-sided Pr > |Z| 0.2375

Output 28.3.2 displays the results from the second TABLES statement. PROC FREQ computes the default 95% confidence limits since the ALPHA= option is not specified. The value of Z is greater than zero, so PROC FREQ computes a right-sided p-value (0.1188). This large p-value provides insufficient evidence to reject the null hypothesis that the proportion of children with fair hair is 28%.

 Chapter Contents Previous Next Top