Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Wilcoxon test to compare two paired sets of data for whether their means differ. Besides the p-value, I would also like to know the power of this test. How to compute it in R? Thank you in advance.

share|improve this question
One comment: The wilcoxon signed rank test, tests the hypothesis that the MEDIANS differ I do believe. – B_Miner Sep 14 '11 at 14:08
B_Miner, no, it is for means. There is an assumption of balance around the median but the medians is not what you're comparing. – John Sep 14 '11 at 14:39
The power depends on the shape of the true distribution of the pairwise differences. You have to specify your assumption what kind of distribution this is. – caracal Sep 14 '11 at 15:34
@john - is the source I cite incorrect? – B_Miner Sep 14 '11 at 18:32
B_Miner... I did a few quick searches. An intro stats text next to me, a Vassar site, and Wikipedia support my assertion. Nevertheless, there are a couple of 'handbooks' like the one you cited that do state it's about differences between medians. I didn't read them all carefully but now I'm thinking about it and I'm wondering if it actually matters. In fact, the NIST reference I found didn't even mention means or medians. hmmmm... probably more time than I want to spend on this topic until I actually want to do one of these. – John Sep 14 '11 at 22:56

I don't know if there's an analytical solution to your question, but when all else fails, one can simulate the distribution you think the two samples come from many thousands of times using Monte Carlo methods. The percentage of those samples the Wilcoxon test correctly identifies as "different" is the power of the test. For example, if you generated 10,000 different simulated paired samples that match your actual data in terms of size and the distribution they came from, and 8,000 of them are correctly identified by the test as different, your power = 0.80.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.