Example 1:
$X_1,...,X_n$ is a random sample from $\text{Poisson}(\lambda)$
$T=\sum X_i$
$T\sim \text{Poisson}(n\lambda)$
Consider the test: $H_0: \lambda \le \lambda_0$ vs $H_1: \lambda > \lambda_0$
The rejection region is of the form $T>c$
Let $\lambda_0=1$ and use CLT to choose $n$ so that the power function $\beta(\lambda)$ satisfies $\beta(1)=0.01$ , $\beta(2)=0.05$. Specify also the "rejection limit" $c$ which you find.
Note: if $Z\sim N(0,1)$ then $P(Z\ge 1.645)=0.05$ and $P(Z\ge 2.326)=0.01$
Solution:
We have $ET=\text{Var}(T)=n\lambda$ and it follows from CLT that if $n$ is large
$\frac{T-n\lambda}{\sqrt(n\lambda)}\sim N(0,1)$
we have
$\beta(1)=P(T>c|\lambda=1)=P(\frac{T-n}{\sqrt{n}}>\frac{c-n}{\sqrt{n}}|\lambda=1)=P(Z>\frac{c-n}{\sqrt{n}})=0.01$
$\beta(2)=P(T>c|\lambda=2)=P(\frac{T-2n}{\sqrt{2n}}>\frac{c-2n}{\sqrt(2n)}|\lambda=2)=P(Z>\frac{c-2n}{\sqrt{2n}})=0.95$
which gives us the equations
$c-n=2.326\sqrt{n}$
$c-2n=-1.645\sqrt{2n}$
which has the solutions $n=21.64$, $c=32.47$ or n=22 and c=33
Example 2:
Let $X_1,...,X_n$ be a random sample from $N(\theta,\sigma ^2)$
$H_0: \theta \le \theta_0 $ vs $H_1: \theta > \theta_0$
reject $H_0$ if $\frac{\bar X-\theta_0}{\sigma /\sqrt {n}}>c$, where $c$ is any positive number
The power function of the test is:
$\beta(\theta)=P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c) = P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c +\frac{\theta_0-\theta}{\sigma /\sqrt n})=P(Z>c+\frac{\theta_0-\theta}{\sigma /\sqrt n})$
Question: Why does the power function become like that? when they are finding $\beta(1), \beta(2)$ etc? The "logic" in example 1 doesn't really seem to match up with the "logic" in example 2? Could someone explain this?
Additionally I am not really understanding the equality in the last line in example 2: basically how: $P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c) = P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c +\frac{\theta_0-\theta}{\sigma /\sqrt n})$.