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

Add option for stratification to the wilcoxon rank-sum test #103

Open
lemireg opened this issue Jan 25, 2025 · 1 comment
Open

Add option for stratification to the wilcoxon rank-sum test #103

lemireg opened this issue Jan 25, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@lemireg
Copy link

lemireg commented Jan 25, 2025

While discussing adding features to VISCfunctions adding the option for stratification to the wilcoxon rank-sum test was suggested. Ollivier asked for this in the 301 BAMA PT report, and it can be done with the same coin package the function already uses. This came up in a discussion with Moni and Shannon.

@lemireg lemireg added the enhancement New feature or request label Jan 25, 2025
@gen0mic
Copy link

gen0mic commented Jan 31, 2025

I just wanted to comment on this, since I was the SRA working on 301 BAMA where Ollivier made this request.

The main function that would need to change is two_samp_cont_test. Specifically the section below line 21 of the function:

as.double(coin::pvalue(coin::wilcox_test(x ~ y, data = data_here, distribution = "exact", ties.method = "mid-ranks", ...)))

To stratify by another factor we would need to incorporate an additional factor (in 301 it was dose):

as.double(coin::pvalue(coin::wilcox_test(x ~ y|z, data = data_here, distribution = "exact", ties.method = "mid-ranks", ...)))

This would also require updating pairwise_test_cont as well, to accept and pass along the new stratification variable to two_samp_cont_test. So another thing to keep in mind.

I was having trouble with the additional helper functions, somewhat pertinent with what Dave Slager brought up in the VISC Programming Series yesterday. So, I wasn't able to modify the code. I can look into this more when I have some extra time and see if I can't get it running. It was a critical report so I needed to get it done quickly and didn't have much time to get familiar with the underlying code.

I think ideally we would give the option to stratify (if necessary) and retain the standard wilcox for most cases.

Happy to discuss further. I can work on a reprex example as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants