Ask George Casella textbook question 8.37 (a) This is from George Casella textbook question 8.37 (a). Let $X_1,...,X_n$ be a random sample from a $n(\theta, \sigma^2)$ population. Consider testing $H_0:\theta\leq \theta_0$ versus $H_1:\theta> \theta_0$.  If $\sigma^2$ is known, show that the test that rejects $H_0$ when
$$\bar{X}>\theta_0+z_\alpha \sqrt{\sigma^2/n}$$ is a test of size $\alpha$. Show that the test can be derived as an LRT.
My understanding of this question is it contains 2 questions. First is to show the size of this test is $\alpha$. The second question is to show this test can be derived as an LRT. I have both problems on these 2 questions.
My attempt of the first question: to show the size is $\alpha$. I show it based on the definition strictly. According to the definition 8.3.5, $\alpha=sup\beta(\theta)=supP(x\in R|H_0)=supP(x\in R|\theta\leq \theta_0)$. Then I first get $P(x\in R)=P(\bar{X}>\theta_0+z_\alpha \sqrt{\sigma^2/n})=P(\bar{X}-\theta>\theta_0-\theta+z_\alpha \sqrt{\sigma^2/n})=P((\bar{X}-\theta)/\sqrt{\sigma^2/n}>(\theta_0-\theta)/\sqrt{\sigma^2/n}+z_\alpha)=P(Z>(\theta_0-\theta)/\sqrt{\sigma^2/n}+z_\alpha)$.
Then I find this probability is increasing in terms of $\theta$, so the supremum under $H_0=\theta\leq \theta_0$ is reached at $\theta=\theta_0$. So the above becomes $P(Z>z_\alpha)$. It is exactly $\alpha$. Then I finish my proof to show the size of this test is $\alpha$. But the solution is very easy. I think the solution is wrong. Because it is not $Z=(\bar{X}-\theta_0)/\sqrt{\sigma^2/n}$, it is $Z=(\bar{X}-\theta)/\sqrt{\sigma^2/n}$. So I think the solution is wrong. But 8.37(a), 8.37(c) both use this solution. Am I correct?
For the second question: to show this test can be derived as an LRT. Yes, I understand and get the step in the solution: it is equivalent  to rejecting if $(\bar{x}-\theta_0)/\sqrt{\sigma^2/n}>c'$. Then we finished the proof? Shouldn't we derive the exact same form of $\bar{X}>\theta_0+z_\alpha \sqrt{\sigma^2/n}$?
The solution is:

 A: For the first question, your thought process and solution is exactly correct. In the problem of testing $H_0: \theta \leq \theta_0$ versus $H_1: \theta > \theta_0$, where $X_1, \dots, X_n \overset{i.i.d.}{\sim} n(\theta, \sigma^2)$ and $\sigma^2$ is known, we have $\Theta_0 = \{\theta: \theta \leq \theta_0\}$ and $\Theta = \{\theta: \theta \in \mathbb{R}\} = \mathbb{R}$. Since the null hypothesis is composite, we do need to use Definition 8.3.5 by explicitly writing out the supremum in order to evaluate the size of a particular test.
(Definition 8.3.5): For $0 \leq \alpha \leq 1$, a test with power function $\beta(\theta)$ is a size $\alpha$ test if $\text{sup}_{\theta \in \Theta_0} \beta(\theta) = \alpha$.
For the second question, the first step is to derive the LRT statistic, given by
$$\lambda(\boldsymbol{x}) = \begin{cases} \dfrac{\text{sup}_{\Theta_0}L(\theta \mid \boldsymbol{x})}{\text{sup}_{\Theta}L(\theta \mid \boldsymbol{x})} = \dfrac{L(\theta_0 \mid \boldsymbol{x})}{L(\bar{x} \mid \boldsymbol{x})} = \cdots = \exp\left(-\dfrac{n(\bar{x}-\theta_0)^2}{2\sigma^2}\right) & \text{if } \bar{x} > \theta_0; \\ 1 & \text{if } \bar{x} \leq \theta_0. \end{cases}$$
The next step is to identify the fact that rejecting if $\lambda < c$ is equivalent to rejecting if $(\bar{x} - \theta_0) / (\sigma / \sqrt{n}) > c'$.
The last step, to be rigorous, is to find the proper constant $c'$ such that the LRT is a test of size $\alpha$. In this case, $c' = z_\alpha$, which completes the proof.
Remark: I guess the solution may have skipped some non-trivial steps for both questions, thus I strongly recommend you only use it as a guide when you get stuck, but not treat it with full mathematical rigor.
