hail
hail copied to clipboard
Add Cochran-Mantel-Haenszel statistical test for association
Description
In this pull request, I add a function to perform a Cochran-Mantel-Haenszel statistical test for association.
This pull request closes #13481.
Testing
I add unit tests. Since I have not used R before (the associated GitHub issue suggests using R to create test cases), I created the unit tests from examples that I found on the internet. I linked these sources in the code for the unit tests.
I built the documentation locally and inspected it to confirm that it matches my expectations.
I am having trouble testing the docstring examples locally. When I run make -C hail doctest-query
, the tests error due to a checksum exception.
Discussion
~I have not added an example to the documentation that uses a matrix table yet. (This is an acceptance criteria in #13481.) I wanted to get some advice about the best way to do this. I think ideally, the example would have a binary phenotype, an allele to test for association, and some stratifying variable. I tried to search through the existing code to find suitable example matrix tables in the docstrings, but I didn't find anything promising. I would appreciate help here.~
Update: thanks to @patrick-schultz's recommendation, I have added an example using a matrix table.