fishers_exact

Crates.iofishers_exact
lib.rsfishers_exact
version1.0.1
sourcesrc
created_at2017-09-14 10:30:30.752662
updated_at2018-11-05 10:13:11.904532
descriptionFisher's exact statistical test.
homepage
repositoryhttps://github.com/cpearce/fishers_exact
max_upload_size
id31709
size16,852
Chris Pearce (cpearce)

documentation

https://docs.rs/fishers_exact

README

Fisher's exact test

Build Status

Implements a 2×2 Fishers exact test. Use this to test the independence of two categorical variables when the sample sizes are small.

For an approachable explanation of Fisher's exact test, see Fisher's exact test of independence by John H. McDonald in the Handbook of Biological Statistics.

The test is computed using code ported from Øyvind Langsrud's JavaScript implementation at http://www.langsrud.com/fisher.htm, used with permission.

use fishers_exact::fishers_exact;

let p = fishers_exact(&[1,9,11,3]).unwrap();

assert!((p.less_pvalue - 0.001346).abs() < 0.0001);
assert!((p.greater_pvalue - 0.9999663).abs() < 0.0001);
assert!((p.two_tail_pvalue - 0.0027594).abs() < 0.0001);
Commit count: 20

cargo fmt