I'm studying about hypothesis test theory and I've reached the next exercise:
Let $X\sim Ber(\theta)$. Then, we know that for a sample of $n=10$, we reject $H_0:\theta = 0.5$, and accept $H_1: \theta = 0.75$ if $\overline{X} > 0.8$.
- Find the test's power function.
- Compute the significance level.
- Compute the power of the hypothesis test.
So, I know a few things that could be useful:
For the first question I know that the power function is defined as $$\mathbb{P}[\text{Reject } \ H_0 \mid \mu]$$
where $\mu$ is the mean of the sample. So I need to compute:
$$\mathbb{P}[\overline{X} > 0.8 \mid \mu]$$
So far, I know that
$$\frac{\overline{X}-\mu}{\frac{\sigma}{\sqrt{n}}}\sim N(0,1)$$
And also that for independent $X_i \sim Ber(\theta)$ then $Y = \sum_{i=1}^{10}X_i \sim Bin(10,\theta)$ and $\mathbb{E}(Y) = 10\theta, \ \sigma_Y = \sqrt{10(\theta)(1-\theta)}$.
Maybe it is a simple exercise but I'm having trouble figuring out the value of $\mu$. For example, for the third question, when I compute the power of the test I did it this way:
\begin{align} \text{Power} &= \mathbb{P}[\overline{X} > 0.8 \mid \theta = 0.75]\\ &= \mathbb{P}\left[\frac{\overline{X} - (10*.75)}{\frac{\sqrt{10*0.75*0.25}}{\sqrt{10}}} > \frac{0.8-(10*0.75)}{\frac{\sqrt{10*0.75*0.25}}{\sqrt{10}}}\right]\\ &= \mathbb{P} [Z > -15.47]\\ &= 1-\phi(-15.47)\\ &= 1 \end{align}
But it confuses me that the power of the test is $1$. And when I compute the significance level $\alpha$ is equal to $1$ too. It seems I'm computing something wrong but I'm lost. Is my $\mu = 10*0.75$ computed the right way?
To use the Central Limit Theorem, and hence approximate the probability by a normal distribution, you need your sample size to be at least $n=30$.
To begin, we know that if $X_{i}$ is $Ber(\theta)$ then $Y=\sum_{i=1}^{n}X_{i}$ is $Bin(n, \theta)$, and the probability mass function (pmf) for $Y$ is $p(y)={n \choose y}\theta^{y}(1-\theta)^{n-y}$.
Now consider $\bar{X}=\frac{1}{n} \sum_{i=1}^{n}X_{i}=nY$. Then using the above pmf, with $y=n\bar{x}$, we get the pmf for $\bar{X}$ as
$p(\bar{x})=Pr(\bar{X}=x)$=${n \choose n\bar{x}} \theta^{n\bar{x}} (1-\theta)^{n-n\bar{x}}$, for $x\in \lbrace 0, \frac{1}{n},...,\frac{n-1}{n}, 1 \rbrace$.
Furthermore, $E(\bar{X})=\theta$ and $Var(\bar{X})=\frac{\theta(1-\theta)}{n}$.
Finally, for the power of the test, you are computing the probability that the null hypothesis is rejected, given that it’s false. That is, you are calculating the probability that you accept the alternative hypothesis given that it’s true. So you need to compute $Pr(\bar{X}>0.8|\theta=0.75)$. You have all the ingredients now to complete the question: you know what the pmf (distribution) of $\bar{X}$ and you know that $\theta=0.75$. Keep in mind that in your case, $n=10$ and the possible values for $\bar{X}$ are $0, \frac{1}{10},...,1$.