Initializing playground…
← Back to roadmap

Contingency Table Analysis

Expected frequencies, relative risk, odds ratio, and association strength — mirrors scipy.stats.contingency functions.

1 — Expected Frequencies

expectedFreq computes the expected cell counts under independence from a 2D observed table.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

2 — Relative Risk (Risk Ratio)

relativeRisk computes the risk ratio and its 95% confidence interval from a 2×2 table.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

3 — Odds Ratio

oddsRatio computes the sample odds ratio and its 95% confidence interval from a 2×2 table.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

4 — Association Strength (Cramér's V)

association measures the strength of association: "phi" for 2×2 tables, "cramer" for larger tables.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent