Intuition for inverting one sided hypothesis tests Is there an intuitive way to remember if we get an upper bound or lower bound for a parameter when inverting a one-sided hypothesis test? In Casella & Berger, it is written:
If we have $H_0: \mu = \mu_0, H_1: \mu < \mu_0$ then "$H_1$ specifies 'large' values of $\mu_0$, so the confidence set will contain 'small' values." I don't really understand this. I interpret $H_1$ as saying that the real value of $\mu$ is smaller than $\mu_0$, I don't really interpret it as saying that $\mu_0$ is large. Can anyone help me build intuition on this?
 A: The authors are not ambivalent here.
If $\mathcal H_1: \mu<\mu_0, $ what should the test function look like? It must reject the null hypothesis $\mathcal H_0: \mu=\mu_0 $ if $\bar x$ of a certain $\mathbf X$ falls shorter than $\mu_0$ by some specific value ie. $$\varphi(\mathbf X) =\begin{cases}1,&\bar x<\mu_0-\textrm{value}\\0,&\textrm{otherwise}\end{cases}\tag 1\label 1.$$ Here, in $\eqref{1}, $ that $\textrm{value}=t_{n-1, ~\alpha}\frac{S}{\sqrt n}.$
So, what should the acceptance region look like? It's simple.
$$A(\mu_0) =\left\{\mathbf X: \bar x \geq \mu_0-t_{n-1, ~\alpha}\frac{S}{\sqrt n}\right\}.\tag 2\label 2$$ It admittedly provides an upper bound when inverting in that
$$C(\mathbf X) =\left\{\mu_0: \bar x +t_{n-1, ~\alpha}\frac{S}{\sqrt n}\geq \mu_0\right\};\tag 3$$ in this sense $\mu_0$ will be "small": smaller than a bound.
A: Recall that a confidence interval collects all hypothesized values for which the corresponding null could not have been rejected given the sample at hand.
So suppose you observe a sample mean of, say, $\bar{x}=1$ and you test the above null that $\mu\geq\mu_0$ against the alternative that $\mu<\mu_0$. Consider, say, $\mu_0=0.5$, so that $\bar{x}>\mu_0$.
Observing an even larger sample mean than the null value surely is no evidence against the correctness of the null, so that this $\mu_0$ should enter the confidence interval. Likewise for, e.g., $\mu_0=\{0,-1-2,\ldots\}$, so that the left endpoint of the c.i. should be $-\infty$.
The right endpoint of the interval will then be the largest null $\mu_0$ larger than $\bar{x}$ such that we still consider it possible that, by chance, we observe such a "small" $\bar{x}$ even though the true $\mu$ is at least as large as that $\mu_0$.
Consider, e.g., a draw from a normal distribution so that
$$
\sqrt{n}(\bar{x}-\mu)/s
$$
follows a t-distribution with $n-1$ d.f., i.e. is a pivot.
Then, we need to find all $\mu$ such that
$$
\sqrt{n}(\bar{x}-\mu)/s> t_{n,\alpha}
$$
with $t_{n,\alpha}$ the $\alpha$-quantile of the $t_{n-1}$ distribution, i.e., all $\mu$ for which we would not reject the null hypothesis.
Rearranging then gives the confidence interval
$$
\bar{x}-s\cdot t_{n,\alpha}/\sqrt{n}>\mu 
$$
or
$$
\mu\in(-\infty,\bar{x}-s\cdot t_{n,\alpha}/\sqrt{n})
$$
Here, recall that, for $\alpha\in(0,0.5)$, $t_{n,\alpha}<0$ so that
$$
\bar{x}-s\cdot t_{n,\alpha}/\sqrt{n}>\bar{x},
$$
as "desired".
In R:
library(MASS) 

n <- 16

x <- mvrnorm(n, 1, 1, empirical = T) # generates numbers with sample mean and variance (and hence) s.d. both forced to 1

t.test(x, alternative="less", mu = -1)

    One Sample t-test

data:  x
t = 8, df = 15, p-value = 1
alternative hypothesis: true mean is less than -1
95 percent confidence interval:
     -Inf 1.438263
sample estimates:
mean of x 
        1 


1-qt(.05, df=n-1)*1/sqrt(n)
[1] 1.438263

