Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. 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'm using the energy library in R to do a two-sample energy test for equality of the underlying distributions of two samples (roughly speaking). As seems to be the standard, the library uses the null hypothesis that the two distributions are equal, but I'm interested in the reverse: I want the null hypothesis to be that the two distributions are NOT equal.

The p-value it gives me is p = 0.972 (under the default null hypothesis). Would it be correct to flip things around and take "the distributions are not equal" as my null hypothesis, with a p-value of 0.028?

share|cite|improve this question
up vote 0 down vote accepted

No this would not be correct. This is because null hypothesis tests and their associated p-values are valid "under the null". The moment you change the null, the p-values constructed previously are invalidated.

Also, the null hypothesis must be definitive. In the case you say the distributions are not equal, the null is not definitive - it is open ended, since two distributions might be unequal in multitudes of ways.

share|cite|improve this answer
Thanks for your answer. How, then, can I test whether these two distributions are equal? Edit: What if I successfully rejected a null hypothesis that P > Q with one test, and rejected another null hypothesis that P < Q with another test (at the same significance level and with the same data)? That would necessarily mean that P = Q, right? – Mike Apr 5 '13 at 5:41
again, you can't test a null hypothesis that is not definitive. P > Q has multitudes of ways of being true, and so does P < Q. The test statistic is always constructed "under a null", and the null must be such that it pins down a definitive distribution against which the likelihood of the test-statistic being realized is evaluated. It is this value that is called the p-value. – Aditya Sihag Apr 5 '13 at 7:39
Okay, so how can I do this properly then? – Mike Apr 5 '13 at 17:08

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.