F. Although not necessary, use a simulation study to approximate the values of \(c\) for each \(n\in \{5,10,...,50\}\). Compare the simulated values of \(c\) to their analytic counterparts.
G. Simulate the rejection rates of this test using the analytic rejection regions for \(\mu\in\{3,3.5,4,4.5\}\). Plot the rejection rates as a function of \(n\) faceted by the effect size \(d\).
Find a general expression for the power function of Test 1 as a function of \(n\) and \(\theta_a\). Plot curve as a function of \(n\) for \(\theta = 1.2.\)
C. Explain why an exact value of \(c_2\) cannot be found analytically and must be simulated.
Unsure about distribution of \(\bar{Y}\) , as normally could find through MGF method, but \(M_Y(t) = \frac{e^{t\theta}-1}{t\theta} \Rightarrow M_{\bar{Y}}(t) = M_Y(\frac{t}{n})^n = (\frac{e^{\frac{t}{n}\theta}-1}{\frac{t}{n}\theta})^n\)
So we do not have a well known form for distribution of \(\bar{Y}\), and thus cannot find \(c_2\).
D. Simulate values of \(c_2\) that yield 5% type-I error rates for Test 2, for \(n \in \{5,10,...,50\}\).
E. Use a simulation study to compare the sizes and the power curves of the two tests as a function of \(n\) for \(\theta_{true} \in \{1,1.1,1.2,1.3\}.\) Use analytic rejection regions for \(Y_{(n)}\) and simulated rejection regions for \(\bar Y\), but simulate the rejection probabilities for both. Plot the simulated Type-I error rate/power as a function of \(n\) for each \(\theta_{true}\). Discuss the properties of these tests: does one seem preferable?
ggplot(data = Hsim) +geom_line(aes(x = n, y =PowerYn,col ="Max Test")) +geom_line(aes(x= n, y = PowerYbar,col ="Mean Test")) +facet_wrap(~theta,labeller =label_bquote(theta == .(theta))) +labs(y ="Null Rejection %",col ="") +theme_classic()
It seems that the test using \(Y_{(n)}\) is more preferable as for all \(\theta_{true}\) it has a higher Null Rejection %, i.e power with the same data.