<?xml version='1.0'?>
<!DOCTYPE art SYSTEM 'http://www.biomedcentral.com/xml/article.dtd'>
<art>
   <ui>cc2428</ui>
   <ji>CCJ</ji>
   <fm>
      <dochead>Review</dochead>
      <bibl>
         <title>
            <p>Statistics review 8: Qualitative data &#8211; tests of association</p>
         </title>
         <aug>
            <au id="A1" ca="yes">
               <snm>Bewick</snm>
               <fnm>Viv</fnm>
               <insr iid="I1"/>
               <email>v.bewick@brighton.ac.uk</email>
            </au>
            <au id="A2">
               <snm>Cheek</snm>
               <fnm>Liz</fnm>
               <insr iid="I1"/>
            </au>
            <au id="A3">
               <snm>Ball</snm>
               <fnm>Jonathan</fnm>
               <insr iid="I2"/>
            </au>
         </aug>
         <insg>
            <ins id="I1">
               <p>Senior Lecturer, School of Computing, Mathematical and Information Sciences, University of Brighton, Brighton, UK</p>
            </ins>
            <ins id="I2">
               <p>Lecturer in Intensive Care Medicine, St George's Hospital Medical School, London, UK</p>
            </ins>
         </insg>
         <source>Critical Care</source>
         <issn>1364-8535</issn>
         <pubdate>2004</pubdate>
         <volume>8</volume>
         <issue>1</issue>
         <fpage>46</fpage>
         <lpage>53</lpage>
         <xrefbib>
            <pubidlist>
               <pubid idtype="doi">10.1186/cc2428</pubid>
               <pubid idtype="pmpid">14975045</pubid>
            </pubidlist>
         </xrefbib>
      </bibl>
      <history>
         <pub>
            <date>
               <day>30</day>
               <month>12</month>
               <year>2003</year>
            </date>
         </pub>
      </history>
      <cpyrt>
         <year>2004</year>
         <collab>BioMed Central Ltd</collab>
      </cpyrt>
      <kwdg>
         <kwd>&#967;<sup>2 </sup>test of association</kwd>
         <kwd>Fisher's exact test</kwd>
         <kwd>McNemar's test</kwd>
         <kwd>odds ratio</kwd>
         <kwd>risk ratio</kwd>
         <kwd>Yates' correction</kwd>
      </kwdg>
      <abs>
         <sec>
            <st>
               <p>Abstract</p>
            </st>
            <p>This review introduces methods for investigating relationships between two qualitative (categorical) variables. The &#967;<sup>2 </sup>test of association is described, together with the modifications needed for small samples. The test for trend, in which at least one of the variables is ordinal, is also outlined. Risk measurement is discussed. The calculation of confidence intervals for proportions and differences between proportions are described. Situations in which samples are matched are considered.</p>
         </sec>
      </abs>
   </fm>
   <meta>
      <classifications>
         <classification type="BMC" subtype="theme_series_title" id="CC_Medical">Medical statistics</classification>
         <classification type="BMC" subtype="theme_series_editor" id="CC_Medical">Jonathan Ball, Viv Bewick and Liz Cheek</classification>
      </classifications>
   </meta>
   <bdy>
      <sec>
         <st>
            <p>Introduction</p>
         </st>
         <p>In the previous statistics reviews most of the procedures discussed are appropriate for quantitative measurements. However, qualitative, or categorical, data are frequently collected in medical investigations. For example, variables assessed might include sex, blood group, classification of disease, or whether the patient survived. Categorical variables may also comprise grouped quantitative variables, for example age could be grouped into 'under 20 years', '20&#8211;50 years' and 'over 50 years'. Some categorical variables may be ordinal, that is the data arising can be ordered. Age group is an example of an ordinal categorical variable.</p>
         <p>When using categorical variables in an investigation, the data can be summarized in the form of frequencies, or counts, of patients in each category. If we are interested in the relationship between two variables, then the frequencies can be presented in a two-way, or contingency, table. For example, Table <tblr tid="T1">1</tblr> comprises the numbers of patients in a two-way classification according to site of central venous cannula and infectious complications. Interest here is in whether there is any relationship, or association, between the site of cannulation and the incidence of infectious complications. The question could also be phrased in terms of proportions, for example whether the proportions of patients in the three groups determined by site of central venous cannula differ according to type of infectious complication.</p>
         <tbl id="T1">
            <title>
               <p>Table 1</p>
            </title>
            <caption>
               <p>Numbers of patients classified by site of central venous cannula and infectious complication</p>
            </caption>
            <tblbdy cols="5">
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="3" ca="center">
                     <p>Infectious complication</p>
                  </c>
                  <c>
                     <p/>
                  </c>
               </r>
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="3">
                     <hr/>
                  </c>
                  <c>
                     <p/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Central line site</p>
                  </c>
                  <c ca="center">
                     <p>None</p>
                  </c>
                  <c ca="center">
                     <p>Exit Site</p>
                  </c>
                  <c ca="center">
                     <p>Bacteraemia/Septicaemia</p>
                  </c>
                  <c ca="center">
                     <p>Total</p>
                  </c>
               </r>
               <r>
                  <c cspan="5">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Internal jugular</p>
                  </c>
                  <c ca="center">
                     <p>686</p>
                  </c>
                  <c ca="center">
                     <p>152</p>
                  </c>
                  <c ca="center">
                     <p>96</p>
                  </c>
                  <c ca="center">
                     <p>934</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Subclavian</p>
                  </c>
                  <c ca="center">
                     <p>451</p>
                  </c>
                  <c ca="center">
                     <p>35</p>
                  </c>
                  <c ca="center">
                     <p>38</p>
                  </c>
                  <c ca="center">
                     <p>524</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Femoral</p>
                  </c>
                  <c ca="center">
                     <p>168</p>
                  </c>
                  <c ca="center">
                     <p>58</p>
                  </c>
                  <c ca="center">
                     <p>22</p>
                  </c>
                  <c ca="center">
                     <p>248</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Total</p>
                  </c>
                  <c ca="center">
                     <p>1305</p>
                  </c>
                  <c ca="center">
                     <p>245</p>
                  </c>
                  <c ca="center">
                     <p>156</p>
                  </c>
                  <c ca="center">
                     <p>1706</p>
                  </c>
               </r>
            </tblbdy>
         </tbl>
      </sec>
      <sec>
         <st>
            <p>&#967;<sup>2 </sup>test of association</p>
         </st>
         <p>In order to test whether there is an association between two categorical variables, we calculate the number of individuals we would get in each cell of the contingency table if the proportions in each category of one variable remained the same regardless of the categories of the other variable. These values are the frequencies we would expect under the null hypothesis that there is no association between the variables, and they are called the expected frequencies. For the data in Table <tblr tid="T1">1</tblr>, the proportions of patients in the sample with cannulae sited at the internal jugular, subclavian and femoral veins are 934/1706, 524/1706, 248/1706, respectively. There are 1305 patients with no infectious complications. So the frequency we would expect in the internal jugular site category is 1305 &#215; (934/1706) = 714.5. Similarly for the subclavian and femoral sites we would expect frequencies of 1305 &#215; (524/1706) = 400.8 and 1305 &#215; (248/1706) = 189.7.</p>
         <p>We repeat these calculations for the patients with infections at the exit site and with bacteraemia/septicaemia to obtain the following:</p>
         <p>Exit site: 245 &#215; (934/1706) = 134.1, 245 &#215; (524/1706) = 75.3, 245 &#215; 248/1706 = 35.6</p>
         <p>Bacteraemia/septicaemia: 156 &#215; (934/1706) = 85.4, 156 &#215; (524/1706) = 47.9, 156 &#215; (248/1706) = 22.7</p>
         <p>We thus obtain a table of expected frequencies (Table <tblr tid="T2">2</tblr>). Note that 1305 &#215; (934/1706) is the same as 934 &#215; (1305/8766), and so equally we could have worded the argument in terms of proportions of patients in each of the infectious complications categories remaining constant for each central line site. In each case, the calculation is conditional on the sizes of the row and column totals and on the total sample size.</p>
         <tbl id="T2">
            <title>
               <p>Table 2</p>
            </title>
            <caption>
               <p>Numbers of patients expected in each classification if there were no association between site of central venous cannula and infectious complication</p>
            </caption>
            <tblbdy cols="5">
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="3" ca="center">
                     <p>Infectious complication</p>
                  </c>
                  <c>
                     <p/>
                  </c>
               </r>
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="3">
                     <hr/>
                  </c>
                  <c>
                     <p/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Central line site</p>
                  </c>
                  <c ca="center">
                     <p>None</p>
                  </c>
                  <c ca="center">
                     <p>Exit Site</p>
                  </c>
                  <c ca="center">
                     <p>Bacteraemia/Septicaemia</p>
                  </c>
                  <c ca="center">
                     <p>Total</p>
                  </c>
               </r>
               <r>
                  <c cspan="5">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Internal jugular</p>
                  </c>
                  <c ca="center">
                     <p>714.5</p>
                  </c>
                  <c ca="center">
                     <p>134.1</p>
                  </c>
                  <c ca="center">
                     <p>85.4</p>
                  </c>
                  <c ca="center">
                     <p>934</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Subclavian</p>
                  </c>
                  <c ca="center">
                     <p>400.8</p>
                  </c>
                  <c ca="center">
                     <p>75.3</p>
                  </c>
                  <c ca="center">
                     <p>47.9</p>
                  </c>
                  <c ca="center">
                     <p>524</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Femoral</p>
                  </c>
                  <c ca="center">
                     <p>189.7</p>
                  </c>
                  <c ca="center">
                     <p>35.6</p>
                  </c>
                  <c ca="center">
                     <p>22.7</p>
                  </c>
                  <c ca="center">
                     <p>248</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Total</p>
                  </c>
                  <c ca="center">
                     <p>1305</p>
                  </c>
                  <c ca="center">
                     <p>245</p>
                  </c>
                  <c ca="center">
                     <p>156</p>
                  </c>
                  <c ca="center">
                     <p>1706</p>
                  </c>
               </r>
            </tblbdy>
         </tbl>
         <p>The test of association involves calculating the differences between the observed and expected frequencies. If the differences are large, then this suggests that there is an association between one variable and the other. The difference for each cell of the table is scaled according to the expected frequency in the cell. The calculated test statistic for a table with r rows and c columns is given by:</p>
         <p>
            <graphic file="cc2428-i1.gif"/>
         </p>
         <p>where O<sub>ij </sub>is the observed frequency and E<sub>ij </sub>is the expectedfrequency in the cell in row i and column j. If the null hypothesis of no association is true, then the calculated test statistic approximately follows a &#967;<sup>2 </sup>distribution with (r - 1) &#215; (c - 1) degrees of freedom (where r is the number of rows and c the number of columns). This approximation can be used to obtain a <it>P </it>value.</p>
         <p>For the data in Table <tblr tid="T1">1</tblr>, the test statistic is:</p>
         <p>1.134 + 2.380 + 1.314 + 6.279 + 21.531 + 2.052 + 2.484 + 14.069 + 0.020 = 51.26</p>
         <p>Comparing this value with a &#967;<sup>2 </sup>distribution with (3 - 1) &#215; (3 - 1) = 4 degrees of freedom, a <it>P </it>value of less than 0.001 is obtained either by using a statistical package or referring to a &#967;<sup>2 </sup>table (such as Table <tblr tid="T3">3</tblr>), in which 51.26 being greater than 18.47 leads to the conclusion that <it>P </it>&lt; 0.001. Thus, there is a probability of less than 0.001 of obtaining frequencies like the ones observed if there were no association between site of central venous line and infectious complication. This suggests that there is an association between site of central venous line and infectious complication.</p>
         <tbl id="T3">
            <title>
               <p>Table 3</p>
            </title>
            <caption>
               <p>Percentage points of the &#967;<sup>2 </sup>distribution produced on a spreadsheet</p>
            </caption>
            <tblbdy cols="5">
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="4" ca="center">
                     <p>&#967;<sup>2 </sup>values for the probabilities (<it>P</it>)</p>
                  </c>
               </r>
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="4">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Degrees of freedom</p>
                  </c>
                  <c ca="left">
                     <p>0.1</p>
                  </c>
                  <c ca="right">
                     <p>0.05</p>
                  </c>
                  <c ca="right">
                     <p>0.01</p>
                  </c>
                  <c ca="right">
                     <p>0.001</p>
                  </c>
               </r>
               <r>
                  <c cspan="5">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>1</p>
                  </c>
                  <c ca="right">
                     <p>2.71</p>
                  </c>
                  <c ca="right">
                     <p>3.84</p>
                  </c>
                  <c ca="right">
                     <p>6.63</p>
                  </c>
                  <c ca="right">
                     <p>10.83</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>2</p>
                  </c>
                  <c ca="right">
                     <p>4.61</p>
                  </c>
                  <c ca="right">
                     <p>5.99</p>
                  </c>
                  <c ca="right">
                     <p>9.21</p>
                  </c>
                  <c ca="right">
                     <p>13.82</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>3</p>
                  </c>
                  <c ca="right">
                     <p>6.25</p>
                  </c>
                  <c ca="right">
                     <p>7.81</p>
                  </c>
                  <c ca="right">
                     <p>11.34</p>
                  </c>
                  <c ca="right">
                     <p>16.27</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>4</p>
                  </c>
                  <c ca="right">
                     <p>7.78</p>
                  </c>
                  <c ca="right">
                     <p>9.49</p>
                  </c>
                  <c ca="right">
                     <p>13.28</p>
                  </c>
                  <c ca="right">
                     <p>18.47</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>5</p>
                  </c>
                  <c ca="right">
                     <p>9.24</p>
                  </c>
                  <c ca="right">
                     <p>11.07</p>
                  </c>
                  <c ca="right">
                     <p>15.09</p>
                  </c>
                  <c ca="right">
                     <p>20.52</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>6</p>
                  </c>
                  <c ca="right">
                     <p>10.64</p>
                  </c>
                  <c ca="right">
                     <p>12.59</p>
                  </c>
                  <c ca="right">
                     <p>16.81</p>
                  </c>
                  <c ca="right">
                     <p>22.46</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>7</p>
                  </c>
                  <c ca="right">
                     <p>12.02</p>
                  </c>
                  <c ca="right">
                     <p>14.07</p>
                  </c>
                  <c ca="right">
                     <p>18.48</p>
                  </c>
                  <c ca="right">
                     <p>24.32</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>8</p>
                  </c>
                  <c ca="right">
                     <p>13.36</p>
                  </c>
                  <c ca="right">
                     <p>15.51</p>
                  </c>
                  <c ca="right">
                     <p>20.09</p>
                  </c>
                  <c ca="right">
                     <p>26.12</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>9</p>
                  </c>
                  <c ca="right">
                     <p>14.68</p>
                  </c>
                  <c ca="right">
                     <p>16.92</p>
                  </c>
                  <c ca="right">
                     <p>21.67</p>
                  </c>
                  <c ca="right">
                     <p>27.88</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>10</p>
                  </c>
                  <c ca="right">
                     <p>15.99</p>
                  </c>
                  <c ca="right">
                     <p>18.31</p>
                  </c>
                  <c ca="right">
                     <p>23.21</p>
                  </c>
                  <c ca="right">
                     <p>29.59</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>11</p>
                  </c>
                  <c ca="right">
                     <p>17.28</p>
                  </c>
                  <c ca="right">
                     <p>19.68</p>
                  </c>
                  <c ca="right">
                     <p>24.72</p>
                  </c>
                  <c ca="right">
                     <p>31.26</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>12</p>
                  </c>
                  <c ca="right">
                     <p>18.55</p>
                  </c>
                  <c ca="right">
                     <p>21.03</p>
                  </c>
                  <c ca="right">
                     <p>26.22</p>
                  </c>
                  <c ca="right">
                     <p>32.91</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>13</p>
                  </c>
                  <c ca="right">
                     <p>19.81</p>
                  </c>
                  <c ca="right">
                     <p>22.36</p>
                  </c>
                  <c ca="right">
                     <p>27.69</p>
                  </c>
                  <c ca="right">
                     <p>34.53</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>14</p>
                  </c>
                  <c ca="right">
                     <p>21.06</p>
                  </c>
                  <c ca="right">
                     <p>23.68</p>
                  </c>
                  <c ca="right">
                     <p>29.14</p>
                  </c>
                  <c ca="right">
                     <p>36.12</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>15</p>
                  </c>
                  <c ca="right">
                     <p>22.31</p>
                  </c>
                  <c ca="right">
                     <p>25.00</p>
                  </c>
                  <c ca="right">
                     <p>30.58</p>
                  </c>
                  <c ca="right">
                     <p>37.70</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>16</p>
                  </c>
                  <c ca="right">
                     <p>23.54</p>
                  </c>
                  <c ca="right">
                     <p>26.30</p>
                  </c>
                  <c ca="right">
                     <p>32.00</p>
                  </c>
                  <c ca="right">
                     <p>39.25</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>17</p>
                  </c>
                  <c ca="right">
                     <p>24.77</p>
                  </c>
                  <c ca="right">
                     <p>27.59</p>
                  </c>
                  <c ca="right">
                     <p>33.41</p>
                  </c>
                  <c ca="right">
                     <p>40.79</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>18</p>
                  </c>
                  <c ca="right">
                     <p>25.99</p>
                  </c>
                  <c ca="right">
                     <p>28.87</p>
                  </c>
                  <c ca="right">
                     <p>34.81</p>
                  </c>
                  <c ca="right">
                     <p>42.31</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>19</p>
                  </c>
                  <c ca="right">
                     <p>27.20</p>
                  </c>
                  <c ca="right">
                     <p>30.14</p>
                  </c>
                  <c ca="right">
                     <p>36.19</p>
                  </c>
                  <c ca="right">
                     <p>43.82</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>20</p>
                  </c>
                  <c ca="right">
                     <p>28.41</p>
                  </c>
                  <c ca="right">
                     <p>31.41</p>
                  </c>
                  <c ca="right">
                     <p>37.57</p>
                  </c>
                  <c ca="right">
                     <p>45.31</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>25</p>
                  </c>
                  <c ca="right">
                     <p>34.38</p>
                  </c>
                  <c ca="right">
                     <p>37.65</p>
                  </c>
                  <c ca="right">
                     <p>44.31</p>
                  </c>
                  <c ca="right">
                     <p>52.62</p>
                  </c>
               </r>
            </tblbdy>
         </tbl>
      </sec>
      <sec>
         <st>
            <p>Residuals</p>
         </st>
         <p>The &#967;<sup>2 </sup>test indicates whether there is an association between two categorical variables. However, unlike the correlation coefficient between two quantitative variables (see Statistics review 7 <abbrgrp><abbr bid="B1">1</abbr></abbrgrp>), it does not in itself give an indication of the strength of the association. In order to describe the association more fully, it is necessary to identify the cells that have large differences between the observed and expected frequencies. These differences are referred to as residuals, and they can be standardized and adjusted to follow a Normal distribution with mean 0 and standard deviation 1 <abbrgrp><abbr bid="B2">2</abbr></abbrgrp>. The adjusted standardized residuals, d<sub>ij</sub>, are given by:</p>
         <p>
            <graphic file="cc2428-i2.gif"/>
         </p>
         <p>Where n<sub>i</sub>. is the total frequency for row i, n.<sub>j </sub>is the total frequency for column j, and N is the overall total frequency. In the example, the adjusted standardized residual for those with cannulae sited at the internal jugular and no infectious complications is calculated as:</p>
         <p>
            <graphic file="cc2428-i3.gif"/>
         </p>
         <p>Table <tblr tid="T4">4</tblr> shows the adjusted standardized residuals for each cell. The larger the absolute value of the residual, the larger the difference between the observed and expected frequencies, and therefore the more significant the association between the two variables. Subclavian site/no infectious complication has the largest residual, being 6.2. Because it is positive there are more individuals than expected with no infectious complications where the subclavian central line site was used. As these residuals follow a Normal distribution with mean 0 and standard deviation 1, all absolute values over 2 are significant (see Statistics review 2 <abbrgrp><abbr bid="B3">3</abbr></abbrgrp>). The association between femoral site/no infectious complication is also significant, but because the residual is negative there are fewer individuals than expected in this cell. When the subclavian central line site was used infectious complications appear to be less likely than when the other two sites were used.</p>
         <tbl id="T4">
            <title>
               <p>Table 4</p>
            </title>
            <caption>
               <p>The adjusted standardized residuals</p>
            </caption>
            <tblbdy cols="4">
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="3" ca="center">
                     <p>Infectious complication</p>
                  </c>
               </r>
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="3">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Central line site</p>
                  </c>
                  <c ca="center">
                     <p>None</p>
                  </c>
                  <c ca="center">
                     <p>Exit Site</p>
                  </c>
                  <c ca="center">
                     <p>Bacteraemia/Septicaemia</p>
                  </c>
               </r>
               <r>
                  <c cspan="4">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Internal jugular</p>
                  </c>
                  <c ca="center">
                     <p>-3.3</p>
                  </c>
                  <c ca="center">
                     <p>2.5</p>
                  </c>
                  <c ca="center">
                     <p>1.8</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Subclavian</p>
                  </c>
                  <c ca="center">
                     <p>6.2</p>
                  </c>
                  <c ca="center">
                     <p>-6.0</p>
                  </c>
                  <c ca="center">
                     <p>-1.8</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Femoral</p>
                  </c>
                  <c ca="center">
                     <p>-3.5</p>
                  </c>
                  <c ca="center">
                     <p>4.4</p>
                  </c>
                  <c ca="center">
                     <p>-0.2</p>
                  </c>
               </r>
            </tblbdy>
         </tbl>
      </sec>
      <sec>
         <st>
            <p>Two by two tables</p>
         </st>
         <p>The use of the &#967;<sup>2 </sup>distribution in tests of association is an approximation that depends on the expected frequencies being reasonably large. When the relationship between two categorical variables, each with only two categories, is being investigated, variations on the &#967;<sup>2</sup>test of association are often calculated as well as, or instead of, the usual test in order to improve the approximation. Table <tblr tid="T5">5</tblr> comprises data on patients with acute myocardial infarction who took part in a trial of intravenous nitrate (see Statistics review 3 <abbrgrp><abbr bid="B4">4</abbr></abbrgrp>). A total of 50 patients were randomly allocated to the treatment group and 45 to the control group. The table shows the numbers of patients who died and survived in each group. The &#967;<sup>2 </sup>test gives a test statistic of 3.209 with 1 degree of freedom and a <it>P </it>value of 0.073. This suggests there is not enough evidence to indicate an association between treatment and survival.</p>
         <tbl id="T5">
            <title>
               <p>Table 5</p>
            </title>
            <caption>
               <p>Data on patients with acute myocardial infarction who took part in a trial of intravenous nitrate</p>
            </caption>
            <tblbdy cols="4">
               <r>
                  <c ca="left">
                     <p>Outcome</p>
                  </c>
                  <c ca="center">
                     <p>Treatment</p>
                  </c>
                  <c ca="center">
                     <p>Control</p>
                  </c>
                  <c ca="center">
                     <p>Total</p>
                  </c>
               </r>
               <r>
                  <c cspan="4">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Died</p>
                  </c>
                  <c ca="center">
                     <p>3</p>
                  </c>
                  <c ca="center">
                     <p>8</p>
                  </c>
                  <c ca="center">
                     <p>11</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Survived</p>
                  </c>
                  <c ca="center">
                     <p>47</p>
                  </c>
                  <c ca="center">
                     <p>37</p>
                  </c>
                  <c ca="center">
                     <p>84</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Total</p>
                  </c>
                  <c ca="center">
                     <p>50</p>
                  </c>
                  <c ca="center">
                     <p>45</p>
                  </c>
                  <c ca="center">
                     <p>95</p>
                  </c>
               </r>
            </tblbdy>
         </tbl>
         <sec>
            <st>
               <p>Fisher's exact test</p>
            </st>
            <p>The exact <it>P </it>value for a two by two table can be calculated by considering all the tables with the same row and column totals as the original but which are as or more extreme in their departure from the null hypothesis. In the case of Table <tblr tid="T5">5</tblr>, we consider all the tables in which three or fewer patients receiving the treatment died, given in Table <tblr tid="T6">6(i)&#8211;(iv)</tblr>. The exact probabilities of obtaining each of these tables under the null hypothesis of no association or independence between treatment and survival are obtained as follows.</p>
            <tbl id="T6">
               <title>
                  <p>Table 6</p>
               </title>
               <caption>
                  <p>Tables with the same row and column totals as Table <tblr tid="T5">5</tblr></p>
               </caption>
               <tblbdy cols="9">
                  <r>
                     <c>
                        <p/>
                     </c>
                     <c cspan="2" ca="center">
                        <p>(i)</p>
                     </c>
                     <c cspan="2" ca="center">
                        <p>(ii)</p>
                     </c>
                     <c cspan="2" ca="center">
                        <p>(iii)</p>
                     </c>
                     <c cspan="2" ca="center">
                        <p>(iv)</p>
                     </c>
                  </r>
                  <r>
                     <c>
                        <p/>
                     </c>
                     <c cspan="8">
                        <hr/>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Outcome</p>
                     </c>
                     <c ca="center">
                        <p>Treatment</p>
                     </c>
                     <c ca="center">
                        <p>Control</p>
                     </c>
                     <c ca="center">
                        <p>Treatment</p>
                     </c>
                     <c ca="center">
                        <p>Control</p>
                     </c>
                     <c ca="center">
                        <p>Treatment</p>
                     </c>
                     <c ca="center">
                        <p>Control</p>
                     </c>
                     <c ca="center">
                        <p>Treatment</p>
                     </c>
                     <c ca="center">
                        <p>Control</p>
                     </c>
                  </r>
                  <r>
                     <c cspan="9">
                        <hr/>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Died</p>
                     </c>
                     <c ca="center">
                        <p>3</p>
                     </c>
                     <c ca="center">
                        <p>8</p>
                     </c>
                     <c ca="center">
                        <p>2</p>
                     </c>
                     <c ca="center">
                        <p>9</p>
                     </c>
                     <c ca="center">
                        <p>1</p>
                     </c>
                     <c ca="center">
                        <p>10</p>
                     </c>
                     <c ca="center">
                        <p>0</p>
                     </c>
                     <c ca="center">
                        <p>11</p>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Survived</p>
                     </c>
                     <c ca="center">
                        <p>47</p>
                     </c>
                     <c ca="center">
                        <p>37</p>
                     </c>
                     <c ca="center">
                        <p>48</p>
                     </c>
                     <c ca="center">
                        <p>36</p>
                     </c>
                     <c ca="center">
                        <p>49</p>
                     </c>
                     <c ca="center">
                        <p>35</p>
                     </c>
                     <c ca="center">
                        <p>50</p>
                     </c>
                     <c ca="center">
                        <p>34</p>
                     </c>
                  </r>
               </tblbdy>
            </tbl>
            <p>To calculate the probability of obtaining a particular table, we consider the total number of possible tables with the given marginal totals, and the number of ways we could have obtained the particular cell frequencies in the table in question. The number of ways the row totals of 11 and 84 could have been obtained given 95 patients altogether is denoted by <sub>95</sub>C<sub>11 </sub>and is equal to 95!/11!84!, where 95! ('95 factorial') is the product of 95 and all the integers lower than itself down to 1. Similarly the number of ways the column totals of 50 and 45 could have been obtained is given by <sub>95</sub>C<sub>50 </sub>= 95!/50!45!. Assuming independence, the total number of possible tables with the given marginal totals is:</p>
            <p>
               <graphic file="cc2428-i4.gif"/>
            </p>
            <p>The number of ways Table <tblr tid="T5">5</tblr> (Table <tblr tid="T6">6[i]</tblr>) could have been obtained is given by considering the number of ways each cell frequency could have arisen. There are <sub>95</sub>C<sub>3 </sub>ways of obtaining the three patients in the first cell. The eight patients in the next cell can be obtained in <sub>92</sub>C<sub>8 </sub>ways from the 95 - 3 = 92 remaining patients. The remaining cells can be obtained in <sub>84</sub>C<sub>47 </sub>and <sub>37</sub>C<sub>37 </sub>(= 1) ways. Therefore, the number of ways of obtaining Table <tblr tid="T6">6(i)</tblr> under the null hypothesis is:</p>
            <p>
               <graphic file="cc2428-i5.gif"/>
            </p>
            <p>Therefore the probability of obtaining <tblr tid="T6">6(i)</tblr> is:</p>
            <p>Therefore the total probability of obtaining the four tables given in Table <tblr tid="T6">6</tblr> is:</p>
            <p>
               <graphic file="cc2428-i6.gif"/>
            </p>
            <p>This probability is usually doubled to give a two-sided <it>P </it>value of 0.140. There is quite a large discrepancy in this case between the &#967;<sup>2 </sup>test and Fisher's exact test.</p>
         </sec>
         <sec>
            <st>
               <p>Yates' continuity correction</p>
            </st>
            <p>In using the &#967;<sup>2 </sup>distribution in the test of association, a continuous probability distribution is being used to approximate discrete probabilities. A correction, attributable to Yates, can be applied to the frequencies to make the test closer to the exact test. To apply Yates' correction for continuity we increase the smallest frequency in the table by 0.5 and adjust the other frequencies accordingly to keep the row and column totals the same. Applying this correction to the data given in Table <tblr tid="T5">5</tblr> gives Table <tblr tid="T7">7</tblr>.</p>
            <tbl id="T7">
               <title>
                  <p>Table 7</p>
               </title>
               <caption>
                  <p>Adjusted frequencies for Yates' correction</p>
               </caption>
               <tblbdy cols="4">
                  <r>
                     <c ca="left">
                        <p>Outcome</p>
                     </c>
                     <c ca="center">
                        <p>Treatment</p>
                     </c>
                     <c ca="center">
                        <p>Control</p>
                     </c>
                     <c ca="center">
                        <p>Total</p>
                     </c>
                  </r>
                  <r>
                     <c cspan="4">
                        <hr/>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Died</p>
                     </c>
                     <c ca="center">
                        <p>3.5</p>
                     </c>
                     <c ca="center">
                        <p>7.5</p>
                     </c>
                     <c ca="center">
                        <p>11</p>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Survived</p>
                     </c>
                     <c ca="center">
                        <p>46.5</p>
                     </c>
                     <c ca="center">
                        <p>37.5</p>
                     </c>
                     <c ca="center">
                        <p>84</p>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Total</p>
                     </c>
                     <c ca="center">
                        <p>50</p>
                     </c>
                     <c ca="center">
                        <p>45</p>
                     </c>
                     <c ca="center">
                        <p>95</p>
                     </c>
                  </r>
               </tblbdy>
            </tbl>
            <p>The &#967;<sup>2 </sup>test using these adjusted figures gives a test statistic of 2.162 with a <it>P </it>value of 0.141, which is close to the <it>P </it>value for Fisher's exact test.</p>
            <p>For large samples the three tests &#8211; &#967;<sup>2</sup>, Fisher's and Yates' &#8211; give very similar results, but for smaller samples Fisher's test and Yates' correction give more conservative results than the &#967;<sup>2 </sup>test; that is the <it>P </it>values are larger, and we are less likely to conclude that there is an association between the variables. There is some controversy about which method is preferable for smaller samples, but Bland <abbrgrp><abbr bid="B5">5</abbr></abbrgrp> recommends the use of Fisher's or Yates' test for a more cautious approach.</p>
         </sec>
      </sec>
      <sec>
         <st>
            <p>Test for trend</p>
         </st>
         <p>Table <tblr tid="T8">8</tblr> comprises the numbers of patients in a two-way classification according to AVPU classification (voice and pain responsive categories combined) and subsequent survival or death of 1306 patients attending an accident and emergency unit. (AVPU is a system for assessing level of consciousness: A = alert, V = voice responsiveness, P = pain responsive and U = unresponsive.) The &#967;<sup>2 </sup>test of association gives a test statistic of 19.38 with 2 degrees of freedom and a <it>P </it>value of less than 0.001, suggesting that there is an association between survival and AVPU classification.</p>
         <tbl id="T8">
            <title>
               <p>Table 8</p>
            </title>
            <caption>
               <p>Number of patients according to AVPU and survival</p>
            </caption>
            <tblbdy cols="5">
               <r>
                  <c ca="left">
                     <p>Outcome</p>
                  </c>
                  <c ca="center">
                     <p>Alert</p>
                  </c>
                  <c ca="center">
                     <p>Voice or pain responsive</p>
                  </c>
                  <c ca="center">
                     <p>Unresponsive</p>
                  </c>
                  <c ca="center">
                     <p>Total</p>
                  </c>
               </r>
               <r>
                  <c cspan="5">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Survived</p>
                  </c>
                  <c ca="center">
                     <p>1110 (91.1%)</p>
                  </c>
                  <c ca="center">
                     <p>54 (79.4%)</p>
                  </c>
                  <c ca="center">
                     <p>14 (70%)</p>
                  </c>
                  <c ca="center">
                     <p>1178</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Died</p>
                  </c>
                  <c ca="center">
                     <p>108 (8.9%)</p>
                  </c>
                  <c ca="center">
                     <p>14 (20.6%)</p>
                  </c>
                  <c ca="center">
                     <p>6 (30%)</p>
                  </c>
                  <c ca="center">
                     <p>128</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Total</p>
                  </c>
                  <c ca="center">
                     <p>1218 (100%)</p>
                  </c>
                  <c ca="center">
                     <p>68 (100%)</p>
                  </c>
                  <c ca="center">
                     <p>20 (100%)</p>
                  </c>
                  <c ca="center">
                     <p>1306</p>
                  </c>
               </r>
            </tblbdy>
         </tbl>
         <p>Because the categories of AVPU have a natural ordering, it is appropriate to ask whether there is a trend in the proportion dying over the levels of AVPU. This can be tested by carrying out similar calculations to those used in regression for testing the gradient of a line (see Statistics review 7 <abbrgrp><abbr bid="B1">1</abbr></abbrgrp>). Suppose the variable 'survival' is regarded as the y variable taking two values, 1 and 2 (survived and died), and AVPU as the x variable taking three values, 1, 2 and 3. We then have six pairs of x, y values, each occurring the number of times equal to the frequency in the table; for example, we have 1110 occurrences of the point (1,1).</p>
         <p>Following the lines of the test of the gradient in regression, with some fairly minor modifications and using large sample approximations, we obtain a &#967;<sup>2 </sup>statistic with 1 degree of freedom given by <abbrgrp><abbr bid="B5">5</abbr></abbrgrp>:</p>
         <p>
            <graphic file="cc2428-i7.gif"/>
         </p>
         <p>For the data in Table <tblr tid="T8">8</tblr>, we obtain a test statistic of 19.33 with 1 degree of freedom and a <it>P </it>value of less than 0.001. Therefore, the trend is highly significant. The difference between the &#967;<sup>2 </sup>test statistic for trend and the &#967;<sup>2 </sup>test statistic in the original test is 19.38 - 19.33 = 0.05 with 2 - 1 = 1 degree of freedom, which provides a test of the departure from the trend. This departure is very insignificant and suggests that the association between survival and AVPU classification can be explained almost entirely by the trend.</p>
         <p>Some computer packages give the trend test, or a variation. The trend test described above is sometimes called the Cochran&#8211;Armitage test, and a common variation is the Mantel&#8211;Haentzel trend test.</p>
      </sec>
      <sec>
         <st>
            <p>Measurement of risk</p>
         </st>
         <p>Another application of a two by two contingency table is to examine the association between a disease and a possible risk factor. The risk for developing the disease if exposed to the risk factor can be calculated from the table. A basic measurement of risk is the probability of an individual developing a disease if they have been exposed to a risk factor (i.e. the relative frequency or proportion of those exposed to the risk factor that develop the disease). For example, in the study into early goal-directed therapy in the treatment of severe sepsis and septic shock conducted by Rivers and coworkers <abbrgrp><abbr bid="B6">6</abbr></abbrgrp>, one of the outcomes measured was in-hospital mortality. Of the 263 patients who were randomly allocated either to early goal-directed therapy or to standard therapy, 236 completed the therapy period with the outcomes shown in Table <tblr tid="T9">9</tblr>.</p>
         <tbl id="T9">
            <title>
               <p>Table 9</p>
            </title>
            <caption>
               <p>Outcomes of the study conducted by Rivers and coworkers</p>
            </caption>
            <tblbdy cols="4">
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="2" ca="center">
                     <p>Outcome</p>
                  </c>
                  <c>
                     <p/>
                  </c>
               </r>
               <r>
                  <c>
                     <p/>
                  </c>
                  <c cspan="2">
                     <hr/>
                  </c>
                  <c>
                     <p/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Therapy</p>
                  </c>
                  <c ca="center">
                     <p>Died</p>
                  </c>
                  <c ca="center">
                     <p>Survived</p>
                  </c>
                  <c ca="center">
                     <p>Total</p>
                  </c>
               </r>
               <r>
                  <c cspan="4">
                     <hr/>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Early goal-directed</p>
                  </c>
                  <c ca="center">
                     <p>38</p>
                  </c>
                  <c ca="center">
                     <p>79</p>
                  </c>
                  <c ca="center">
                     <p>117</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Standard</p>
                  </c>
                  <c ca="center">
                     <p>59</p>
                  </c>
                  <c ca="center">
                     <p>60</p>
                  </c>
                  <c ca="center">
                     <p>119</p>
                  </c>
               </r>
               <r>
                  <c ca="left">
                     <p>Total</p>
                  </c>
                  <c ca="center">
                     <p>97</p>
                  </c>
                  <c ca="center">
                     <p>139</p>
                  </c>
                  <c ca="center">
                     <p>236</p>
                  </c>
               </r>
            </tblbdy>
            <tblfn>
               <p>Presented are data on outcomes from the study conducted by Rivers and coworkers on early goal-directed therapy in severe sepsis and septic shock <abbrgrp><abbr bid="B6">6</abbr></abbrgrp>.</p>
            </tblfn>
         </tbl>
         <p>From the table it can be seen that the proportion of patients receiving early goal-directed therapy who died is 38/117 = 32.5%, and so this is the risk for death with early goal-directed therapy. The risk for death on the standard therapy is 59/119 = 49.6%.</p>
         <p>Another measurement of the association between a disease and possible risk factor is the odds. This is the ratio of those exposed to the risk factor who develop the disease compared with those exposed to the risk factor who do not develop the disease. This is best illustrated by a simple example. If a bag contains 8 red balls and 2 green balls, then the probability (risk) of drawing a red ball is 8/10 whereas the odds of drawing a red ball is 8/2. As can be seen, the measurement of odds, unlike risk, is not confined to the range 0&#8211;1. In the study conducted by Rivers and coworkers <abbrgrp><abbr bid="B6">6</abbr></abbrgrp> the odds of death with early goal-directed therapy is 38/79 = 0.48, and on the standard therapy it is 59/60 = 0.98.</p>
         <sec>
            <st>
               <p>Confidence interval for a proportion</p>
            </st>
            <p>As the measurement of risk is simply a proportion, the confidence interval for the population measurement of risk can be calculated as for any proportion. If the number of individuals in a random sample of size n who experience a particular outcome is r, then r/n is the sample proportion, p. For large samples the distribution of p can be considered to be approximately Normal, with a standard error of <abbrgrp><abbr bid="B2">2</abbr></abbrgrp>:</p>
            <p>
               <graphic file="cc2428-i8.gif"/>
            </p>
            <p>The 95% confidence interval for the true population proportion, p, is given by p - 1.96 &#215; standard error to p + 1.96 &#215; standard error, which is:</p>
            <p>
               <graphic file="cc2428-i9.gif"/>
            </p>
            <p>where p is the sample proportion and n is the sample size. The sample proportion is the risk and the sample size is the total number exposed to the risk factor.</p>
            <p>For the study conducted by Rivers and coworkers <abbrgrp><abbr bid="B6">6</abbr></abbrgrp> the 95% confidence interval for the risk for death on early goal-directed therapy is 0.325 &#177; 1.96(0.325 [1-0.325]/117)<sup>0.5 </sup>or (24.0%, 41.0%), and on the standard therapy it is (40.6%, 58.6%). The interpretation of a confidence interval is described in (see Statistics review 2 <abbrgrp><abbr bid="B3">3</abbr></abbrgrp>) and indicates that, for those on early goal-directed therapy, the true population risk for death is likely to be between 24.0% and 41.0%, and that for the standard therapy between 40.6% and 58.6%.</p>
         </sec>
      </sec>
      <sec>
         <st>
            <p>Comparing risks</p>
         </st>
         <p>To assess the importance of the risk factor, it is necessary to compare the risk for developing a disease in the exposed group with the risk in the nonexposed group. In the study by Rivers and coworkers <abbrgrp><abbr bid="B6">6</abbr></abbrgrp> the risk for death on the early goal-directed therapy is 32.5%, whereas on the standard therapy it is 49.6%. A comparison between the two risks can be made by examining either their ratio or the difference between them.</p>
         <sec>
            <st>
               <p>Risk ratio</p>
            </st>
            <p>The risk ratio measures the increased risk for developing a disease when having been exposed to a risk factor compared with not having been exposed to the risk factor. It is given by RR = risk for the exposed/risk for the unexposed, and it is often referred to as the relative risk. The interpretation of a relative risk is described in Statistics review 6 <abbrgrp><abbr bid="B7">7</abbr></abbrgrp>. For the Rivers study the relative risk = 0.325/0.496 = 0.66, which indicates that a patient on the early goal-directed therapy is 34% less likely to die than a patient on the standard therapy.</p>
            <p>The calculation of the 95% confidence interval for the relative risk <abbrgrp><abbr bid="B8">8</abbr></abbrgrp> will be covered in a future review, but it can usefully be interpreted here. For the Rivers study the 95% confidence interval for the population relative risk is 0.48 to 0.90. Because the interval does not contain 1.0 and the upper end is below, it indicates that patients on the early goal-directed therapy have a significantly decreased risk for dying as compared with those on the standard therapy.</p>
         </sec>
         <sec>
            <st>
               <p>Odds ratio</p>
            </st>
            <p>When quantifying the risk for developing a disease, the ratio of the odds can also be used as a measurement of comparison between those exposed and not exposed to a risk factor. It is given by OR = odds for the exposed/odds for the unexposed, and is referred to as the odds ratio. The interpretation of odds ratio is described in Statistics review 3 <abbrgrp><abbr bid="B4">4</abbr></abbrgrp>. For the Rivers study the odds ratio = 0.48/0.98 = 0.49, again indicating that those on the early goal-directed therapy have a reduced risk for dying as compared with those on the standard therapy. This will be covered fully in a future review.</p>
            <p>The calculation of the 95% confidence interval for the odds ratio <abbrgrp><abbr bid="B2">2</abbr></abbrgrp> will also be covered in a future review but, as with relative risk, it can usefully be interpreted here. For the Rivers example the 95% confidence interval for the odds ratio is 0.29 to 0.83. This can be interpreted in the same way as the 95% confidence interval for the relative risk, indicating that those receiving early goal-directed therapy have a reduced risk for dying.</p>
         </sec>
         <sec>
            <st>
               <p>Difference between two proportions</p>
            </st>
            <sec>
               <st>
                  <p>Confidence interval</p>
               </st>
               <p>For the Rivers study, instead of examining the ratio of the risks (the relative risk) we can obtain a confidence interval and carry out a significance test of the difference between the risks. The proportion of those on early goal-directed therapy who died is p<sub>1 </sub>= 38/117 = 0.325 and the proportion of those on standard therapy who died is p<sub>2 </sub>= 59/119 = 0.496. A confidence interval for the difference between the true population proportions is given by:</p>
               <p>(p<sub>1 </sub>- p<sub>2</sub>) - 1.96 &#215; se(p<sub>1 </sub>- p<sub>2</sub>) to (p<sub>1 </sub>- p<sub>2</sub>) + 1.96 &#215; se(p<sub>1 </sub>- p<sub>2</sub>)</p>
               <p>Where se(p<sub>1 </sub>- p<sub>2</sub>) is the standard error of p<sub>1 </sub>- p<sub>2 </sub>and is calculated as:</p>
               <p>
                  <graphic file="cc2428-i10.gif"/>
               </p>
               <p>Thus, the required confidence interval is -0.171 - 1.96 &#215; 0.063 to -0.171 + 1.96 &#215; 0.063; that is -0.295 to -0.047. Therefore, the difference between the true proportions is likely to be between -0.295 and -0.047, and the risk for those on early goal-directed therapy is less than the risk for those on standard therapy.</p>
            </sec>
            <sec>
               <st>
                  <p>Hypothesis test</p>
               </st>
               <p>We can also carry out a hypothesis test of the null hypothesis that the difference between the proportions is 0. This follows similar lines to the calculation of the confidence interval, but under the null hypothesis the standard error of the difference in proportions is given by:</p>
               <p>
                  <graphic file="cc2428-i11.gif"/>
               </p>
               <p>where p is a pooled estimate of the proportion obtained from both samples <abbrgrp><abbr bid="B5">5</abbr></abbrgrp>:</p>
               <p>
                  <graphic file="cc2428-i12.gif"/>
               </p>
               <p>So:</p>
               <p>
                  <graphic file="cc2428-i13.gif"/>
               </p>
               <p>The test statistic is then:</p>
               <p>
                  <graphic file="cc2428-i14.gif"/>
               </p>
               <p>Comparing this value with a standard Normal distribution gives p = 0.007, again suggesting that there is a difference between the two population proportions. In fact, the test described is equivalent to the &#967;<sup>2</sup>test of association on the two by two table. The &#967;<sup>2 </sup>test gives a test statistic of 7.31, which is equal to (-2.71)<sup>2 </sup>and has the same <it>P </it>value of 0.007. Again, this suggests that there is a difference between the risks for those receiving early goal-directed therapy and those receiving standard therapy.</p>
            </sec>
         </sec>
      </sec>
      <sec>
         <st>
            <p>Matched samples</p>
         </st>
         <p>Matched pair designs, as discussed in Statistics review 5 <abbrgrp><abbr bid="B9">9</abbr></abbrgrp>, can also be used when the outcome is categorical. For example, when comparing two tests to determine a particular condition, the same individuals can be used for each test.</p>
         <sec>
            <st>
               <p>McNemar's test</p>
            </st>
            <p>In this situation, because the &#967;<sup>2 </sup>test does not take pairing into consideration, a more appropriate test, attributed to McNemar, can be used when comparing these correlated proportions.</p>
            <p>For example, in the comparison of two diagnostic tests used in the determination of <it>Helicobacter pylori</it>, the breath test and the Oxoid test, both tests were carried out in 84 patients and the presence or absence of <it>H. pylori </it>was recorded for each patient. The results are shown in Table <tblr tid="T10">10</tblr>, which indicates that there were 72 concordant pairs (in which the tests agree) and 12 discordant pairs (in which the tests disagree). The null hypothesis for this test is that there is no difference in the proportions showing positive by each test. If this were true then the frequencies for the two categories of discordant pairs should be equal <abbrgrp><abbr bid="B5">5</abbr></abbrgrp>. The test involves calculating the difference between the number of discordant pairs in each category and scaling this difference by the total number of discordant pairs. The test statistic is given by:</p>
            <tbl id="T10">
               <title>
                  <p>Table 10</p>
               </title>
               <caption>
                  <p>The results of two tests to determine the presence of <it>Helicobacter pylori</it></p>
               </caption>
               <tblbdy cols="4">
                  <r>
                     <c>
                        <p/>
                     </c>
                     <c cspan="2" ca="center">
                        <p>Breath test</p>
                     </c>
                     <c>
                        <p/>
                     </c>
                  </r>
                  <r>
                     <c>
                        <p/>
                     </c>
                     <c cspan="2">
                        <hr/>
                     </c>
                     <c>
                        <p/>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Oxoid test</p>
                     </c>
                     <c ca="center">
                        <p>+</p>
                     </c>
                     <c ca="center">
                        <p>-</p>
                     </c>
                     <c ca="center">
                        <p>Total</p>
                     </c>
                  </r>
                  <r>
                     <c cspan="4">
                        <hr/>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>+</p>
                     </c>
                     <c ca="center">
                        <p>40</p>
                     </c>
                     <c ca="center">
                        <p>8 (b)</p>
                     </c>
                     <c ca="center">
                        <p>48</p>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>-</p>
                     </c>
                     <c ca="center">
                        <p>4 (c)</p>
                     </c>
                     <c ca="center">
                        <p>32</p>
                     </c>
                     <c ca="center">
                        <p>36</p>
                     </c>
                  </r>
                  <r>
                     <c ca="left">
                        <p>Total</p>
                     </c>
                     <c ca="center">
                        <p>44</p>
                     </c>
                     <c ca="center">
                        <p>40</p>
                     </c>
                     <c ca="center">
                        <p>84(n)</p>
                     </c>
                  </r>
               </tblbdy>
            </tbl>
            <p>
               <graphic file="cc2428-i15.gif"/>
            </p>
            <p>Where b and c are the frequencies in the two categories of discordant pairs (as shown in Table <tblr tid="T10">10</tblr>). The calculated test statistic is compared with a &#967;<sup>2 </sup>distribution with 1 degree of freedom to obtain a <it>P </it>value. For the example b = 8 and c = 4, therefore the test statistic is calculated as 1.33. Comparing this with a &#967;<sup>2 </sup>distribution gives a <it>P </it>value greater than 0.10, indicating no significant difference in the proportion of positive determinations of <it>H. pylori </it>using the breath and the Oxoid tests.</p>
            <p>The test can also be carried out with a continuity correction attributed to Yates <abbrgrp><abbr bid="B5">5</abbr></abbrgrp>, in a similar way to that described above for the &#967;<sup>2</sup>test of association. The test statistic is then given by:</p>
            <p>
               <graphic file="cc2428-i16.gif"/>
            </p>
            <p>and again is compared with a &#967;<sup>2 </sup>distribution with 1 degree of freedom. For the example, the calculated test statistic including the continuity correct is 0.75, giving a <it>P </it>value greater than 0.25.</p>
            <p>As with nonpaired proportions a confidence interval for the difference can be calculated. For large samples the difference between the paired proportions can be approximated to a Normal distribution. The difference between the proportions can be calculated from the discordant pairs <abbrgrp><abbr bid="B8">8</abbr></abbrgrp>, so the difference is given by (b - c)/n, where n is the total number of pairs, and the standard error of the difference by (b + c)<sup>0.5</sup>/n.</p>
            <p>For the example where b = 8, c = 4 and n = 84, the difference is calculated as 0.048 and the standard error as 0.041. The approximate 95% confidence interval is therefore 0.048 &#177; 1.96 &#215; 0.041 giving -0.033 to 0.129. As this spans 0, it again indicates that there is no difference in the proportion of positive determinations of <it>H. pylori </it>using the breath and the Oxoid tests.</p>
         </sec>
      </sec>
      <sec>
         <st>
            <p>Limitations</p>
         </st>
         <p>For a &#967;<sup>2 </sup>test of association, a recommendation on sample size that is commonly used and attributed to Cochran <abbrgrp><abbr bid="B5">5</abbr></abbrgrp> is that no cell in the table should have an expected frequency of less than one, and no more than 20% of the cells should have an expected frequency of less than five. If the expected frequencies are too small then it may be possible to combine categories where it makes sense to do so.</p>
         <p>For two by two tables, Yates' correction or Fisher's exact test can be used when the samples are small. Fisher's exact test can also be used for larger tables but the computation can become impossibly lengthy.</p>
         <p>In the trend test the individual cell sizes are not important but the overall sample size should be at least 30.</p>
         <p>The analyses of proportions and risks described above assume large samples with similar requirement to the &#967;<sup>2 </sup>test of association <abbrgrp><abbr bid="B8">8</abbr></abbrgrp>.</p>
         <p>The sample size requirement often specified for McNemar's test and confidence interval is that the number of discordant pairs should be at least 10 <abbrgrp><abbr bid="B8">8</abbr></abbrgrp>.</p>
      </sec>
      <sec>
         <st>
            <p>Conclusion</p>
         </st>
         <p>The &#967;<sup>2 </sup>test of association and other related tests can be used in the analysis of the relationship between categorical variables. Care needs to be taken to ensure that the sample size is adequate.</p>
      </sec>
      <sec>
         <st>
            <p>Competing interests</p>
         </st>
         <p>None declared.</p>
      </sec>
      <sec>
         <st>
            <p>Box</p>
         </st>
         <p>This article is the eighth in an ongoing, educational review series on medical statistics in critical care.</p>
         <p>Previous articles have covered 'presenting and summarizing data', 'samples and populations', 'hypothesestesting and <it>P </it>values', 'sample size calculations', 'comparison of means', 'nonparametric means' and 'correlation and regression'.</p>
         <p>Future topics to be covered include:</p>
         <p>Chi-squared and Fishers exact tests</p>
         <p>Analysis of variance</p>
         <p>Further non-parametric tests: Kruskal&#8211;Wallis and Friedman</p>
         <p>Measures of disease: PR/OR</p>
         <p>Survival data: Kaplan&#8211;Meier curves and log rank tests</p>
         <p>ROC curves</p>
         <p>Multiple logistic regression.</p>
         <p>If there is a medical statistics topic you would like explained, contact us at editorial@ccforum.com.</p>
      </sec>
      <sec>
         <st>
            <p>Abbreviations</p>
         </st>
         <p>AVPU: A = alert, V = voice responsiveness, P = pain responsive and U = unresponsive</p>
      </sec>
   </bdy>
   <bm>
      <refgrp>
         <bibl id="B1">
            <title>
               <p>Statistics review 7: Correlation and regression</p>
            </title>
            <aug>
               <au>
                  <snm>Bewick</snm>
                  <fnm>V</fnm>
               </au>
               <au>
                  <snm>Cheek</snm>
                  <fnm>L</fnm>
               </au>
               <au>
                  <snm>Ball</snm>
                  <fnm>J</fnm>
               </au>
            </aug>
            <source>Crit Care</source>
            <pubdate>2003</pubdate>
            <volume>7</volume>
            <fpage>451</fpage>
            <lpage>459</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="doi">10.1186/cc2401</pubid>
                  <pubid idtype="pmpid" link="fulltext">14624685</pubid>
                  <pubid idtype="pmcid">374386</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B2">
            <aug>
               <au>
                  <snm>Everitt</snm>
                  <fnm>BS</fnm>
               </au>
            </aug>
            <source>The Analysis of Contingency Tables</source>
            <publisher>London, UK: Chapman &amp; Hall</publisher>
            <edition>2</edition>
            <pubdate>1992</pubdate>
         </bibl>
         <bibl id="B3">
            <title>
               <p>Statistics review 2: samples and populations</p>
            </title>
            <aug>
               <au>
                  <snm>Whitley</snm>
                  <fnm>E</fnm>
               </au>
               <au>
                  <snm>Ball</snm>
                  <fnm>J</fnm>
               </au>
            </aug>
            <source>Crit Care</source>
            <pubdate>2002</pubdate>
            <volume>6</volume>
            <fpage>143</fpage>
            <lpage>148</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="pmcid">137296</pubid>
                  <pubid idtype="pmpid" link="fulltext">11983040</pubid>
                  <pubid idtype="doi">10.1186/cc1473</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B4">
            <title>
               <p>Statistics review 3: hypothesis testing and <it>P </it>values</p>
            </title>
            <aug>
               <au>
                  <snm>Whitley</snm>
                  <fnm>E</fnm>
               </au>
               <au>
                  <snm>Ball</snm>
                  <fnm>J</fnm>
               </au>
            </aug>
            <source>Crit Care</source>
            <pubdate>2002</pubdate>
            <volume>6</volume>
            <fpage>222</fpage>
            <lpage>225</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="pmcid">137449</pubid>
                  <pubid idtype="pmpid" link="fulltext">12133182</pubid>
                  <pubid idtype="doi">10.1186/cc1493</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B5">
            <aug>
               <au>
                  <snm>Bland</snm>
                  <fnm>M</fnm>
               </au>
            </aug>
            <source>An Introduction to Medical Statistics</source>
            <publisher>Oxford, UK: Oxford University Press</publisher>
            <edition>3</edition>
            <pubdate>2001</pubdate>
         </bibl>
         <bibl id="B6">
            <title>
               <p>Early goal-directed therapy in the treatment of severe sepsis and septic shock</p>
            </title>
            <aug>
               <au>
                  <snm>Rivers</snm>
                  <fnm>E</fnm>
               </au>
               <au>
                  <snm>Nguyen</snm>
                  <fnm>B</fnm>
               </au>
               <au>
                  <snm>Havstad</snm>
                  <fnm>S</fnm>
               </au>
               <au>
                  <snm>Ressler</snm>
                  <fnm>J</fnm>
               </au>
               <au>
                  <snm>Muzzin</snm>
                  <fnm>A</fnm>
               </au>
               <au>
                  <snm>Knoblich</snm>
                  <fnm>B</fnm>
               </au>
               <au>
                  <snm>Peterson</snm>
                  <fnm>E</fnm>
               </au>
               <au>
                  <snm>Tomlanovich</snm>
                  <fnm>M</fnm>
               </au>
               <au>
                  <cnm>Early Goal-Directed Therapy Collaborative Group</cnm>
               </au>
            </aug>
            <source>N Engl J Med</source>
            <pubdate>2001</pubdate>
            <volume>345</volume>
            <fpage>1368</fpage>
            <lpage>1377</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="doi">10.1056/NEJMoa010307</pubid>
                  <pubid idtype="pmpid" link="fulltext">11794169</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B7">
            <title>
               <p>Statistics review 6: Nonparametric methods</p>
            </title>
            <aug>
               <au>
                  <snm>Whitley</snm>
                  <fnm>E</fnm>
               </au>
               <au>
                  <snm>Ball</snm>
                  <fnm>J</fnm>
               </au>
            </aug>
            <source>Crit Care</source>
            <pubdate>2002</pubdate>
            <volume>6</volume>
            <fpage>509</fpage>
            <lpage>513</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="pmcid">153434</pubid>
                  <pubid idtype="pmpid" link="fulltext">12493072</pubid>
                  <pubid idtype="doi">10.1186/cc1820</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B8">
            <aug>
               <au>
                  <snm>Kirkwood</snm>
                  <fnm>BR</fnm>
               </au>
               <au>
                  <snm>Sterne</snm>
                  <fnm>JAC</fnm>
               </au>
            </aug>
            <source>Essential Medical Statistics</source>
            <publisher>Oxford, UK: Blackwell Science Ltd</publisher>
            <edition>2</edition>
            <pubdate>2003</pubdate>
         </bibl>
         <bibl id="B9">
            <title>
               <p>Statistics review 5: Comparison of means</p>
            </title>
            <aug>
               <au>
                  <snm>Whitley</snm>
                  <fnm>E</fnm>
               </au>
               <au>
                  <snm>Ball</snm>
                  <fnm>J</fnm>
               </au>
            </aug>
            <source>Crit Care</source>
            <pubdate>2002</pubdate>
            <volume>6</volume>
            <fpage>424</fpage>
            <lpage>428</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="pmcid">137324</pubid>
                  <pubid idtype="pmpid" link="fulltext">12398782</pubid>
                  <pubid idtype="doi">10.1186/cc1548</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
      </refgrp>
   </bm>
</art>
