Changeset 2382 for trunk/test/fisher.cc


Ignore:
Timestamp:
Dec 21, 2010, 2:16:58 PM (11 years ago)
Author:
Peter
Message:

merged patch release 0.6.3 into trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/test/fisher.cc

    r2370 r2382  
    22
    33/*
    4   Copyright (C) 2008, 2009 Peter Johansson
     4  Copyright (C) 2008, 2009, 2010 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2424#include "yat/statistics/Fisher.h"
    2525
     26#include <climits>
     27
    2628using namespace theplu::yat;
    2729void test_p_value(test::Suite&);
    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();
     72}
     73
     74
     75void test_large_numbers(test::Suite& suite)
     76{
     77  // skip test if unsigned int is 16 bit
     78  if ((UINT_MAX >> 16) == 0) {
     79    suite.out() << "skipping test_large_numbers\n";
     80    return;
     81  }
     82 
     83  statistics::Fisher f;
     84  double oddsratio = f.oddsratio(1166,63326825-1166,1095,66074759-1095);
     85  if (oddsratio<0.5 || oddsratio>2) {
     86    suite.err() << "oddsratio: " << oddsratio << "\n";
     87    suite.err() << "expected ~ 1\n";
     88    suite.xadd(false);
     89  }
     90  suite.add(suite.equal_fix(f.p_value(), 0.0123, 0.0001));
     91  f.p_value_one_sided();
    6892}
    6993
Note: See TracChangeset for help on using the changeset viewer.