-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Summary
No response
Details
Summary
Add a new Chapter 15/16 style case study for epidemiology:
- Simulate a simple binary exposure / binary outcome dataset with strata
(e.g., age group). - Provide an analysis script that computes:
- crude risk ratio,
- stratum-specific risk ratios,
- and a pooled / adjusted risk ratio (e.g., Mantel–Haenszel).
This issue is for building the basic simulator + analyzer skeleton.
We can refine the statistics and narrative in later issues.
Files to add
scripts/sim_epi_rr_strata.py– simulator for stratified 2×2 tablesscripts/chXX_epi_rr_strata.py– analyzer (chapter number TBD; use XX for now)- Makefile targets:
-
epi-rr-ci(small n, CI smoke) -
epi-rr(full demo)
-
- Tests:
- Add the new scripts to
tests/test_cli_smoke.py.
- Add the new scripts to
Goals
- Simulator: generate a small dataset with columns like:
id,stratum,exposed(0/1),outcome(0/1)
- Analyzer: read a
--dataor--datadirinput and compute:- crude risk ratio with a confidence interval (basic is fine),
- per-stratum 2×2 counts and risk ratios,
- a placeholder for pooled/adjusted RR (even if initially just a TODO + rough calculation).
- Use the shared CLI helper (
scripts/_cli.py) for argument parsing. - Wire the new scripts into the Makefile and smoke test.
Hints
- Look at the existing pattern for Ch13/Ch14/Ch15:
- simulator script → CSV in
data/synthetic/ - analyzer script → summaries/plots in
outputs/...
- simulator script → CSV in
- For a first pass, you can use simple formulas from standard epi texts,
or even rely onstatsmodelsif convenient. - Keep everything small, clear, and easily extended in follow-up issues.
Difficulty
Medium: good first issue for someone interested in biostats/epidemiology
and comfortable with basic Python and 2×2 tables.
Files to Touch
No response
Contributor Checklist
- I have read
CONTRIBUTING.md. - I can run
make lintlocally. - I can run
make testlocally. - I have checked for existing issues/PRs that might overlap.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed