I have a set of numbers generated by an unknown to me random distribution. When I calculate the average of these numbers, I get a number that is larger than zero. I want to know how likely it is that the mean of the distribution is really larger than zero.

To answer this question I have designed the following non-parametric test:

  1. I calculate the mean value of the numbers that I have.
  2. From each number that I have in my set I subtract the mean. In that way I get a new set of numbers (whose mean is equal to zero per definition).
  3. I randomly choose a number from the new set as many times as there number in the original set. Each choice is independent. It means that the same number can be chosen several times or not chosen at all.
  4. I calculate the average of the set of randomly generated numbers.
  5. I do it many times and check how often the average is as large as the real one.

Here is an example, to make it more clear. Let us assume that my original set of numbers is

[1.1, 3.7, 2.2, 7.8, 9.4]

The mean of these numbers is 4.84. I subtract this mean from all my numbers and as a result I get:

[-3.74, -1.14, -2.64, 2.96, 4.56]

I sample 5 numbers from this new set. As a result I could get:

[4.56, 4.56, -2.64, -3.74, -1.14, 2.96]

I calculate the mean of these numbers (it is 0.76). Then I sample from the same normalised set of numbers ([-3.74, -1.14, -2.64, 2.96, 4.56]) and calculate its mean.

I do it many times and check how often these means are larger than the original mean.

So, now the question is if this test is meaningful or it has some logical flows.

Of course I my real case I have more values that 5 (around 5000). Also their average is not as larger as 4.84 (it is much closer to zero (around 0.004)).

  • 1
    $\begingroup$ This looks like a particular form of bootstrap-type test. You might wish to search those up. A good reference on boostrapping is Davison and Hinkley's Bootstrap Methods and Their Application (I believe Chapter 4 is on tests). $\:$ On the other hand, if you want a more traditional nonparametric test, and are prepared to assume symmetry under the null then a test based on the means using permutation of signs would work $\endgroup$
    – Glen_b
    Sep 12, 2018 at 1:07

2 Answers 2


I'd suggest using a well-established method over a homemade method. In your case, given that you don't know the underlying distribution, it seems that the Wilcoxon Signed Rank test would test the hypothesis you are considering.

Keep in mind this doesn't actually tell you about the mean, rather if your data is symmetric it tells you about the median and if your data is not symmetric it tells you whether the underlying generation process is the same. Read more here: http://rcompanion.org/handbook/F_02.html


The best option which does not assume something about the distribution would be bootstrap estimators (see page from wiki). It has a section also on how to estimate the sample mean. I favor bootstrapping rather than Wilcoxson because you have enough samples for the bootstrap estimator to be robust and because of the symmetry assumption from Wilcoxon test.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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