Function fishers_exact

Source
pub fn fishers_exact(
    table: &[u64; 4],
    alternative: Alternative,
) -> Result<f64, FishersExactTestError>
Expand description

Perform a Fisher exact test on a 2x2 contingency table. Based on scipy’s fisher test: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.fisher_exact.html#scipy-stats-fisher-exact Expects a table in row-major order Returns only the p_value

§Examples

use statrs::stats_tests::fishers_exact;
use statrs::stats_tests::Alternative;
let table = [3, 5, 4, 50];
let p_value = fishers_exact(&table, Alternative::Less).unwrap();