Skip to main content

relative_risk_py

Function relative_risk_py 

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

Calculate relative risk (risk ratio) for a 2x2 contingency table.

The relative risk is a measure of association between exposure and outcome in cohort studies. It represents the risk of outcome in the exposed group relative to the unexposed group.

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

Relative Risk = [a/(a+b)] / [c/(c+d)]

Parameters: table: 2x2 array of observed frequencies

Returns: Relative risk value