hail
hail copied to clipboard
[query] implement the Cochran–Mantel–Haenszel test for repeated tests of independence
What happened?
@jkgoodrich requested this.
It appears to be a fairly straightforward manipulation of the four variables. Hail already has the chi-squared CDF. I think we can implement this entirely in Python.
Acceptance criteria:
- Tests comparing the results to results from R. Ensure we have tests for small, intermediate, and large p-values.
- Method should accept at least the four parameters and they should be named a, b, c, and d.
- Method should return the test statistics as well as its p-value (i.e. the value of the chi-squared CDF at the test statistic)
- Docs should include concrete examples with explicit values.
- Docs should include an example of using it in a Hail table.
References:
- http://www.biostathandbook.com/cmh.html
- https://en.wikipedia.org/wiki/Cochran–Mantel–Haenszel_statistics
- https://cran.r-project.org/web/packages/samplesizeCMH/vignettes/samplesizeCMH-introduction.html
Version
0.2.120
Relevant log output
No response
I would like to work on this issue—I will try to implement this.