-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Return Confidence Interval for nonparametric Mann Whitney U Test #225
Comments
raphaelvallat#225 Implemented CI from 'Calculating confidence intervals for some non-parametric analyses', Campbell and Gardner 1988. CI Style is adapted from ttest. The same publication offers a solution for wilcoxon, which is not yet implemented but could be added fairly easily.
Hi @kschuerholt, Thank you for opening the issue and submitting a PR. I'll dive into the latter in the next few days. This is related to #153. Thanks, |
Thans for your great work, glad to be able to contribute in a small way. #153 seems to be the same feature request for wilcoxon. The paper I used for the PR also gives CI interavals for wilcoxon, the computation is very similar to the one for mwu. It does look different to the CI computation in R, but I'm no statistician. Best, |
Thank you @kschuerholt! Looking at the documentation of the wilcox.test R function, it seems that they are using the following formula: Myles Hollander and Douglas A. Wolfe (1973). Nonparametric Statistical Methods. New York: John Wiley & Sons. Pages 27--33 (one-sample), 68--75 (two-sample).
That said, the paper that you have used for the MWU test is more recent than the paper they refer to, and I think it would make sense to use the formula they provide to implement CI for the wilcoxon test as well. Is this something you would have time and bandwidth to implement? A few other comments on the PR:
k = int(round(ct1*ct2/2 - (N * (ct1*ct2*(ct1+ct2+1)/12)**0.5))) Thank you so much for your help on this, |
I can't promise an ETA, but I can implement the corresponding CI method for wilcoxon in the next days or weeks. I checked the source again. The paper I cited earlier is basically a user's reference, it's only cited 3 times. They in turn appear to take the CI computation method from Regarding the other comments:
Cheers, |
Hi @kschuerholt, Thank you! That would be great if you could have a look at the wilcoxon CI, but no pressure at all. I am already very thankful for your contribution. I was thinking that since there does not seem to be a single gold-standard method, we could also smply report the bootstrapped confidence intervals, using either scipy.stats.bootstrap or pingouin's own pg.compute_bootci function. However, this would drastically increase computation time, so if we use this we would need to allow the users to disable the CI though (e.g. by setting Also, please don't worry about the decimal rounding for now. I'll do a deep dive to fix this once the PR is ready. Thanks, |
The t-test returns amongst other useful values the confidence interval on the difference between the means.
A CI on the difference of medians would be super useful to have for nonparametric tests like the MWU, so that not everybody has to comb through literature to figure out how to compute CIs for nonparametric tests.
I'm not entirely sure if for generic cases that'd require bootstrapping, or if closed-form solutions exist and robust enough.
A method to compute CIs for nonparametric tests is, i.e., given in Calculating confidence intervals for some non-parametric analyses, Michael J Campbell and Martin J Gardner, British Medical Journal 1988.
The text was updated successfully, but these errors were encountered: