The FREQ Procedure

# Example 9: Testing Marginal Homogeneity with Cochran's Q

Procedure features:
TABLES statement, multiple requests
TABLES statement options:
 AGREE NOCUM NOPRINT
WEIGHT statement
Other features:
 FORMAT procedure

This example

• creates frequency tables for the analysis variables using existing cell counts

• computes tests and measures of agreement, which include Cochran's Q statistic for stratified 2×2 contingency tables

• suppresses the cumulative frequencies and cumulative percentages

• suppresses the display of contingency tables.

When a binary response is measured several times or under different conditions, Cochran's Q tests that the marginal probability of a positive response is unchanged across the times or conditions. When there are more than two response categories, you can use PROC CATMOD in SAS/STAT software to fit a repeated-measures model. Data for this example are from Categorical Data Analysis by Alan Agresti. Copyright © 1990. Reprinted by permission of John Wiley and Sons, Inc.

 ```options nodate pageno=1 linesize=80 pagesize=60; proc format; value \$responsefmt 'F'='Favorable' 'U'='Unfavorable'; run;```
 ```data drugs; input Drug_A \$ Drug_B \$ Drug_C \$ Count @@; datalines; F F F 6 F F U 16 F U F 2 F U U 4 U F F 2 U F U 4 U U F 6 U U U 6 ;```
 ```proc freq data=drugs; weight count;```
 ` tables drug_a drug_b drug_c/nocum;`
 ` tables drug_a*drug_b*drug_c/agree noprint;`
 ``` format drug_a drug_b drug_c \$responsefmt.; title 'Study of Three Drug Treatments for a Chronic Disease'; run;```

 The one-way frequency tables provides the marginal response for each drug. For drugs A and B, 61% of the subjects reported a favorable response while 35% of the subjects reported a favorable response for drug C.
 McNemar's test shows strong discordance between drugs B and C when the response to drug A is favorable. A small negative value of simple kappa indicates no agreement between the drug B response and the drug C response. In this example, the hypothesis of interest is whether the response to treatment is equal for the three drugs. Cochran's Q is statistically significant (p=.014), which leads to rejection of the null hypothesis that the probability of favorable response is the same for the three drugs.