MitsuhaMiyamizu / FishersExactTest.jl

An accurate and native implementation of Fisher's Exact Test for Julia.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FishersExactTest.jl

An accurate and Julia-native implementation of Fisher's Exact Test for Julia. (No need to ccall external C library)

Motivation

We and someone else found an accuracy-related bug in the implementation of Fisher's Exact Test provided by JuliaStats, it seems that due to technical limitations behind their algorithm, the bug cannot be fixed in a short period of time.

To ensure the accuracy of the implementation in our package, we compare our result to known facts in Wikipedia and use fisher.test in R to validate our result, which yields a spot-on match.

How to use

Simply by querying

import Pkg; Pkg.add("FishersExactTest")
using FishersExactTest
FisherExact2x2Test(a, b, c, d);

k = FisherExact2x2Test(a, b, c, d, opt = :silent);
k.p          # p_value
k.left_tail  # left_tail
k.right_tail # right_tail
k.two_tail   # two_sides

# Options for printing
FisherExact2x2Test(a, b, c, d, opt = :verbose);
# Options for suppress print
k = FisherExact2x2Test(a, b, c, d, opt = :silent);

where a, b, c, d are distributed in

a b
c d

Reference

Fisher's Exact Test was extracted from bedtools

Courtesy

@Ionizing

@atlasmir

About

An accurate and native implementation of Fisher's Exact Test for Julia.

License:MIT License


Languages

Language:Julia 46.7%Language:C++ 45.4%Language:C 6.6%Language:Makefile 1.2%