How to test a hypothesis for mean difference within a range Suppose we have two distributions X and Y with the mean of X greater than or equal to the mean of Y. I want to test the hypothesis that $H_0: \bar{X} - \bar{Y} <= d $ v.s. $H_a: \bar{X} - \bar{Y} > d$ for a given d. Which test statistics should I use for testing such hypothesis?

This becomes clearer if you replace $Y$ with a transformation, $Z = Y + d$.
Your hypotheses then become:

*

*$H_0: \bar X - \bar Z \leq 0$, or $\bar X \leq \bar Z$

*$H_a: \bar X - \bar Z \gt 0$, or $\bar X \gt \bar Z$
This can easily be tested using a one-tailed t-test, if you're assuming Normal distributions, or a one-tailed Mann-Whitney test if you're not making that assumption.
