Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Table Analysis

Association in a 2 × 2 Table

The most basic table is a 2 × 2 table. Usually, the columns represent some sort of outcome, often yes or no, and the rows represent levels of a factor that may influence the outcome. Suppose, for example, that researchers were investigating the properties of a new "ouchless" bandaid for children. Interest lies in whether those children trying the test bandaid recorded fewer complaints on removal than those children using a regular bandaid. You can address this question by forming the two-way table of bandaid type and complaint status and then assessing the association between the rows and columns of that table.

Open the Bandaid Data Set

These data are provided as the Bandaid data set in the Analyst Sample Library. To open the Bandaid data set, follow these steps:

  1. Select Tools arrow Sample Data ...
  2. Select Bandaid.
  3. Click OK to create the sample data set in your Sasuser directory.
  4. Select File arrow Open By SAS Name ...
  5. Select Sasuser from the list of Libraries.
  6. Select Bandaid from the list of members.
  7. Click OK to bring the Bandaid data set into the data table.

Figure 9.2 displays the data table containing these data. Note that the data are in frequency form, with the variable count containing the frequencies of the profile contained in each row of the table. The variable type is the type of bandaid tested and the variable outcome is the status of complaints.

c09tab00.gif (1902 bytes)

Figure 9.2: Data Set Bandaid in the Data Table

Specify the Table

To construct the appropriate two-way table and request tests of association, follow these steps:

  1. Select Statistics arrow Table Analysis ...
  2. Select type from the candidate list as the Row variable.
  3. Select outcome from the candidate list as the Column variable.
  4. Select count from the candidate list as the Cell Counts variable.

Figure 9.3 displays the resulting dialog.

c09tab01.gif (5636 bytes)

Figure 9.3: Table Analysis Task for Bandaid Study

Request Tests and Measures of Association

By selecting the rows and columns of the table, you have requested the construction of a 2 × 2 table. To request chi-square tests of association and the odds ratio, which is a measure of association, follow these steps:

  1. Click on the Statistics button.
  2. Select Chi-square statistics.
  3. Select Measures of association.
  4. Click OK.

Figure 9.4 displays the Statistics dialog.

c09tab02.gif (6169 bytes)

Figure 9.4: Statistics Dialog

Finally, in order to customize the form of the displayed table, follow these steps:

  1. Click on the Tables button.
  2. Select Observed under Frequencies.
  3. Select Row under Percentages.
  4. Click OK.

Figure 9.5 displays the resulting Tables dialog.

c09tab03.gif (3811 bytes)

Figure 9.5: Tables Dialog

This requests that only the raw frequencies and the row percentages be listed in the printed table cell.

Click OK in the Table Analysis dialog to perform the analysis.

Review the Results

The frequency table is displayed in Figure 9.6. Note that 46 percent of those children getting regular bandaids had complaints about irritation when their bandaid was removed, compared to 25 percent of those children receiving the test bandaid.

c09tab04.gif (6120 bytes)

Figure 9.6: Frequency Table for Bandaid Data

Figure 9.7 contains the table of computed chi-square statistics for this table. The Pearson chi-square statistic, labeled "Chi-Square," has a value of 3.57 and an associated p-value of 0.0588 with 1 degree of freedom. If you were doing strict hypothesis testing, you would not reject the hypothesis of no association at the \alpha=0.05 level of significance. However, researchers in this case found enough evidence in this pilot study to continue looking into the new product.

c09t045.gif (8832 bytes)

Figure 9.7: Chi-Square Statistics for Bandaid Data

Several other chi-square statistics also appear in this output, such as the likelihood ratio chi-square and the Mantel-Haenszel chi-square. These statistics are asymptotically equivalent.

c09tab05.gif (5855 bytes)

Figure 9.8: Odds Ratio for Bandaid Data

Figure 9.8 contains the table of relative risk estimates including the odds ratio, which is labeled "Case-Control." The odds ratio is the ratio of the odds of having an outcome for one group versus another. When the odds ratio has the value 1, you have equal odds of having the outcome. When the odds ratio is greater than 1, one group has greater odds of an outcome than the other.

The odds ratio has a value of 2.62, which means that the odds of a complaint are 2.62 times higher for those children using the regular bandaid than for those using the test bandaid.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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