Changeset 2314


Ignore:
Timestamp:
Aug 20, 2010, 12:26:13 AM (11 years ago)
Author:
Peter
Message:

refs #638. adding a test for Fisher with large values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.6-stable/test/fisher_test.cc

    r1797 r2314  
    2020*/
    2121
     22#include <climits>
     23
    2224#include "Suite.h"
    2325
     
    2830void test_p_value_approximative(test::Suite&);
    2931void test_p_value_exact(test::Suite&);
     32void test_large_numbers(test::Suite&);
    3033
    3134int main(int argc, char* argv[])
     
    6568  }
    6669  test_p_value(suite);
     70  test_large_numbers(suite);
    6771  return suite.return_value();
    6872}
     
    116120
    117121}
     122
     123void test_large_numbers(test::Suite& suite)
     124{
     125  statistics::Fisher f;
     126  double oddsratio = f.oddsratio(1166,63326825-1166,1095,66074759-1095);
     127  if (oddsratio<0.5 || oddsratio>2) {
     128    suite.err() << "oddsratio: " << oddsratio << "\n";
     129    suite.err() << "expected ~ 1\n";
     130    suite.xadd(false);
     131  }
     132
     133}
Note: See TracChangeset for help on using the changeset viewer.