<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FAQ/ChiExact</title><revhistory><revision><revnumber>17</revnumber><date>2013-08-28 10:50:52</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>16</revnumber><date>2013-08-28 10:50:07</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>15</revnumber><date>2013-08-28 09:06:24</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>14</revnumber><date>2013-08-28 09:05:52</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>13</revnumber><date>2013-08-28 08:51:38</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>12</revnumber><date>2013-08-28 08:50:01</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>11</revnumber><date>2013-08-28 08:48:02</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>10</revnumber><date>2013-08-28 08:47:39</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>9</revnumber><date>2013-08-28 08:44:42</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>8</revnumber><date>2013-04-26 14:10:08</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>7</revnumber><date>2013-03-08 10:17:38</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>6</revnumber><date>2009-10-22 09:12:01</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>5</revnumber><date>2007-03-22 16:14:04</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>4</revnumber><date>2007-03-22 16:11:32</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>3</revnumber><date>2007-03-22 16:08:23</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>2</revnumber><date>2007-03-22 16:07:14</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>1</revnumber><date>2007-03-22 16:06:05</date><authorinitials>PeterWatson</authorinitials></revision></revhistory></articleinfo><section><title>Exact test vs chi-square?</title><para>Howell (2002) on p.158 explains a difficulty using the Pearson chi-square test for testing the independence of frequencies in two-way tables. Namely that when the <emphasis>expected</emphasis> cell frequencies are less than five the Pearson statistics does not follow a chi-square distribution. </para><para>Instead it is recommended by Howell that Fisher's exact test is used when any expected frequency is less than five although Pett (1997) suggests problems using alternatives to chi-square tests if fewer than a fifth of expected values are less than five. Ian Campbell (2007) mentions <ulink url="http://www.iancampbell.co.uk/twobytwo/twobytwo.htm">here</ulink> that the exact test is too conservative for 2x2 tables and suggests, instead, using an alternative chi-square, The N-1 chi-square, which performs well provided all expected counts are 1 or greater.  Bruce Weaver shows <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiExact/statswiki/FAQ/ChiExact?action=AttachFile&amp;do=get&amp;target=nm1chisq.pdf">here</ulink> that the N-1 chi-square is equivalent to the linear-by-linear chi-square test outputted by SPSS CROSSTABS and it may also be computed using the on-line calculator on Ian Campbell's website. </para><para>For a 2x2 table <emphasis>only</emphasis> Bruce shows <ulink url="https://sites.google.com/a/lakeheadu.ca/bweaver/Home/statistics/notes/chisqr_assumptions">here</ulink> that the N-1 chi-square can easily be obtained from the Pearson chi-square since </para><screen><![CDATA['N -1' chi-square = Linear-by-Linear chi-square = Pearson chi-square x (N -1) / N]]></screen><para><ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiExact/statswiki/FAQ/ChiSquaredSpss#">CROSSTABS</ulink> in SPSS, consequently,  outputs how many expected cell frequencies are less than five whenever a chi-square test is performed. Fisher's exact test may be requested by pressing on the exact button in the crosstabs dialogue box and requesting 'exact'. Alternatively the <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiExact/statswiki/SoftwareNotes#">locally available software</ulink> program fishrc computes this test on a UNIX machine. </para><para>The p-value can then be quoted. This p-value is always two-sided except in the case of a 2 by 2 table where it can also be one-sided. </para><para>For EXCEL users the BINOMDIST function can be used for exact probabilities for the special case of a single proportion (equivalently a 2 by 1 table) using its cumulative distribution function.  </para><para>For example BINOMDIST(11,23,0.5,TRUE) = the probability of observing at most 11 'correct' out of a possible 23 assuming the chance of observing a correct is equal to a half = 0.5 (since 11 is the midpoint of the distribution and the binomial distribution is symmetric). </para><para><emphasis role="underline">References</emphasis> </para><para>Campbell I (2007) Chi-squared and Fisher-Irwin tests of two-by-two tables with small sample recommendations. <emphasis>Statistics in Medicine</emphasis>, <emphasis role="strong">26</emphasis>, 3661 - 3675. A pre-print of this paper is available <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/ChiExact/statswiki/FAQ/ChiExact?action=AttachFile&amp;do=get&amp;target=chisq2x2.pdf">in pdf format from here.</ulink>  </para><para>Howell DC (2002) Statistical methods for psychology fifth edition: Duxbury Press:Pacific Grove, CA. </para><para>Pett MA (1997) Nonparametric statistics for Health Care Research. Sage publications:London. </para></section></article>