Say we have a sample of size n from a geometric random variable with rate p, that \(P(X=x)=p(1-p)^{x-1}\); \(x=1,2,...\).
As an example we have the data set
x | Freq |
---|---|
1 | 49 |
2 | 23 |
3 | 14 |
4 | 8 |
5 | 4 |
6 | 2 |
In this homework you can use R for numerical calculations but you can not use any of the probability routines such as pgeom, qbinom etc.
Find the mle of \(p\)
Derive an exact hypothesis test for
\[H_0: p=p_0\text{ vs. }H_a:p>p_0\] based on the mle.
Find the power of this test. Use it to draw the power curve for the case \(n=100, p_0=0.5,\alpha=0.05\) and \(p_1\in [0.5,0.65]\).
If in fact \(p=0.54\), what sample size n would be needed so that the test has a power of 80%?
Find another test, again based on the mle but now using a normal approximation (aka the central limit theorem). For the case \(n=100,\alpha=0.05,p_1=0.6\), which of these tests is more powerful?