Chapter Contents


The FREQ Procedure

Example 9: Testing Marginal Homogeneity with Cochran's Q

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

This example

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.

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;

proc format;
   value $responsefmt 'F'='Favorable'
 Note about code
data drugs;
   input Drug_A $ Drug_B $ Drug_C $ Count @@;
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
 Note about code
proc freq data=drugs;
   weight count;
 Note about code
   tables drug_a drug_b drug_c/nocum;
 Note about code
   tables drug_a*drug_b*drug_c/agree noprint;
 Note about code
   format drug_a drug_b drug_c $responsefmt.;
   title 'Study of Three Drug Treatments for a Chronic Disease';

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. [HTML Output]
 [Listing Output]
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.

[HTML Output]
 [Listing Output]

Chapter Contents



Top of Page

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