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?

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

