Understanding bootstrap hypothesis testing I want to use bootstrap hypothesis testing to test if the mean of 1 distribution is greater than the other. With no other assumptions on the two distributions (e.g., they don't need to be gaussian).
I found this paragraph in the wikipedia article:
https://en.wikipedia.org/wiki/Bootstrapping_(statistics)#Bootstrap_hypothesis_testing
I have two questions:

*

*Is the algorithm indicated in the link above testing for the hypothesis -- "the mean of X is greater than the mean of Y"? i.e., the null hypothesis being "the mean of X is not greater than the mean of Y". If it's not testing for this, how can we test for this?



*What is Step 2 doing?

I'm rather confused at this:
Create two new data sets whose values are: 
x_i^' = x_i - X + Z and 
y_i^' = y_i - Y + Z 
where Z is the mean of the combined sample.

At a high level, this seems to be "normalizing" samples with the joint mean. Why is this needed?

The null hypothesis is that the means of two distributions are the same. By subtracting the sample mean then adding the combined mean, both distributions now have the same mean (Z).
You can read more here:
Two methods of using bootstraping to test the difference between two sample means
Why shift the mean of a bootstrap distribution when conducting a hypothesis test?
