pub fn fishers_exact_with_odds_ratio(
table: &[u64; 4],
alternative: Alternative,
) -> Result<(f64, 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 the odds ratio and p_value
§Examples
use statrs::stats_tests::fishers_exact_with_odds_ratio;
use statrs::stats_tests::Alternative;
let table = [3, 5, 4, 50];
let (odds_ratio, p_value) = fishers_exact_with_odds_ratio(&table, Alternative::Less).unwrap();