Skip to main content

odds_ratio_py

Function odds_ratio_py 

Source
pub fn odds_ratio_py(table: &Bound<'_, PyArray2<f64>>) -> PyResult<f64>
Expand description

Calculate odds ratio for a 2x2 contingency table.

The odds ratio is a measure of association between exposure and outcome. It represents the odds of outcome occurring in the exposed group relative to the unexposed group.

For a 2x2 table: Outcome+ Outcome- Exposed+ a b Exposed- c d

Odds ratio = (ad) / (bc)

Parameters: table: 2x2 array of observed frequencies

Returns: Odds ratio value