# Hypothesis testing: Null Hypothesis for one-sided tests

With a one sided test, we might want to assess if a sample mean is greater than some theoretical mean (or the other way round):

$H_A: \mu_S > \mu_T$

What confuses me is that even for one-sided test the Null-hypothesis is described as equality between the means, i.e.: $H_0: \mu_S = \mu_T$ . Why is that? Would the opposite of $H_A$ in this case not be that the our sample mean is either equal OR smaller than the theoretical value, i.e. $H_0: \mu_T \geq \mu_S$?

This is a common approach in some introductory statistics textbooks. The alternative hypothesis can be directional (e.g., $H_a : \mu > \mu_0$) or non-directional (e.g., $H_a : \mu \ne \mu_0$), but the null hypothesis is always written as an equality (e.g., $H_0 : \mu = \mu_0$).

Your evaluation is correct: this would be the mutually exclusive alternative only for the non-directional test. The appropriate mutually exclusive option for the first alternative hypothesis above would properly be $H_0 : \mu \le \mu_0$.

So, ¿why do textbook authors sometimes just always write the null with the equality sign? Well, it comes down to what you can (and cannot) draw. I can draw a picture of a hypothetical world where the population mean is a given value (say $\mu_0$). I can sketch the normal curve, indicate the center is at $\mu_0$, and I'm good to go. What I can't do is draw infinitely many other such curves were $\mu \le \mu_0$.

OK...but ¿won't the $P$-values be different if I drew different curves? Yes, they would, but if you conduct a thought-experiment of what the new $P$-value would be if you did have a normal curve with a shifted mean, that new $P$-value will always be less than the one you calculated with the fixed null hypothesis.

And in the end, technically, I can't calculate a separate $P$-value for the infinite options indicated in $H_0: \mu \le \mu_0$, but I can calculate one for $H_0 : \mu = \mu_0$. (Well, not if we aren't going down a Bayesian path...)**

Hope this helps justify the pedagogic rationale behind this (seemingly) wrong conventional notation.

**This comment is based on the more simplistic definition of $P$-value used in most introductory statistics textbook. A more general definition of the $P$-value can account for this, and is described in another answer below.

• Very helpful! I find it very important (and very instructive) to care about such details too, so thank you:-)! Practically however, when I conduct a one-sided test, this then implies that H_0 gets rejected when equality does not hold if I understand you correctly (because only then we can calculate a specific p-value)? – user24544 Apr 22 '18 at 14:45
• Let's say we have a $p=.022$ with a one-sided test $H_0 : \mu \ge 0$. This means our test statistic is a negative value. If we have any value for $\mu$ greater than 0, say, 0.5, the test statistic will be even farther away from the mean, thus with a lower $P$-value. So, if you reject with $H_0 : \mu = 0$, you would reject with $H_0 : \mu \ge 0$. – Gregg H Apr 22 '18 at 14:51
• Gregg, I would modify your penultime paragraph. See Scortchi's answer. ;) – An old man in the sea. Apr 23 '18 at 10:45

@GreggH's answer is excellent, but seems, in the penultimate paragraph, to hint at something fishy going on. In fact a formal definition of p-values takes this kind of situation into account.

When the null hypothesis is composite, specifying a set of values $\Theta_0$ for the unknown parameter $\theta$, a valid p-value $p(x)=\alpha$ (where $x$ is the observed data) is one which has a distribution function at $\alpha$ that does not exceed $\alpha$ whatever the value of $\theta$ might be (within $\Theta_0$):

$$\Pr_\theta \left[ p(X)\leq\alpha \right] \leq \alpha \quad \forall \theta \in \Theta_0, \ \forall\alpha\in[0,1]$$

One way of ensuring validity is simply to construct the p-value as the supremum of the probability that a test statistic $T$ exceeds or equals its observed value $t$ over all values of $\theta$ within $\Theta_0$:

$$p(x) = \sup_{\theta\in\Theta_0} \Pr_\theta\left[T\geq t\right]$$

In many cases the location of the supremum can easily be seen to be at the boundary with the alternative hypothesis, so there's no difference between testing $H_0:\theta=\theta_0$ or $H_0: \theta\leq\theta_0$ vs $H1:\theta>\theta_0$.

† In general $\theta$ may be a vector, say $(\phi,\lambda$), with one component, say $\phi$, being the parameter of interest, & the other, say $\lambda$, being a nuisance parameter; another way to construct a valid p-value is to condition on a statistic that's sufficient for $\lambda$ when $\phi=\phi_0$.