How do I plot the power of the likelihood ratio test I have a random sample of $25$ observations, which follow a normal distribution with mean $\mu$ and variance $100$. I have to graph the power of the likelihood ratio test of $H_0: \mu =0 $ and $H_A:\mu \neq 0$ at significance level $\alpha=0.1$.
I found the power of the likelihood ratio test to be: $1+\phi(-\frac{\mu}{2}-1.645)-\phi(-\frac{\mu}{2}+1.645).$
I'm confused on how to plot the function in R, and would really appreciate the help! Thank you :)
 A: You are testing $H_0: \mu = 0$ vs $H_a: \mu \ne 0$ at the 0.1% level.
The power against the specific alternative $\mu_a\ne 0$ is the probability of rejection if $X_i$ are a random sample of size $n = 25$ from $\mathsf{Norm}(\mu = \mu_a, \sigma = 10).$
I suppose you mean to say that the power against $\mu_a\ne 0$ is given by
$$1 + \Phi\left(-\frac{\mu_a}{2} - 1.645\right) - \Phi\left(-\frac{\mu_a}{2} + 1.645\right),$$
where $\Phi(\cdot)$ is the standard normal CDF.
Here is a plot of the power curve in R, where pnorm is a normal CDF. [The point at $(0,.1)$
shows the significance level.]
mu.a = seq(-8,8, by=.01)
p.rej = 1 + pnorm(-mu.a/2-1.645) - pnorm(-mu.a/2+1.645)
plot(mu.a, p.rej, type="l", ylim=c(0,1))  # 'ell' not '1'
 abline(h=0:1, col="green2")
 abline(v=0, col="green2")


For comparison, here is output for this situation from
a recent release of Minitab.
Power and Sample Size 

1-Sample Z Test

Testing mean = null (versus ≠ null)
Calculating power for mean = null + difference
α = 0.1  Assumed standard deviation = 10

            Sample
Difference    Size     Power
        -5      25  0.803782
         5      25  0.803782

Power Curve for 1-Sample Z Test 


