Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: odds_ratio inf and 0 have no or_ci_lower or_ci_upper #31

Open
berntpopp opened this issue Dec 19, 2024 · 0 comments
Open

bug: odds_ratio inf and 0 have no or_ci_lower or_ci_upper #31

berntpopp opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@berntpopp
Copy link
Member

When calculating odds ratios, certain edge cases (e.g., no events in one group) can result in infinite or zero values. The current custom code does not produce meaningful confidence interval bounds (or_ci_lower, or_ci_upper) in such scenarios. We should rely on a standard, well-tested statistical function to compute odds ratios and their confidence intervals.

Rationale:
Using a robust statistical library or a well-established function will handle edge cases correctly and produce valid confidence intervals, even in extreme situations. This improves the reliability and interpretability of the results.

Proposed Changes:

  1. Replace the custom odds ratio and CI computation code with a standard function from a reputable Python library (e.g., statsmodels).
  2. Ensure that edge cases (inf, 0) produce sensible or bounded confidence intervals (e.g., using standard approximations or fallback values).
  3. Add tests with scenarios that previously resulted in inf or 0 to ensure correct output.
@berntpopp berntpopp self-assigned this Dec 19, 2024
@berntpopp berntpopp added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant