Exercise 1. Consider a Bernoulli statistical model, where the probability of a success is the parameter of interest and
Posted: Mon Apr 11, 2022 6:20 am
a,b,c,d,e,f,g from answers
Exercise 1. Consider a Bernoulli statistical model, where the probability of a success is the parameter of interest and there are n independent observations x = {21, ..., X1} where Xi = 1 with probability 0 and X; = 0) with probability 1-0. Define the hypotheses H. : 0 = 0, and HA: 0 = 0 A, and assume a = 0.05 and 0, < 0A. A,
(h) Now use a t-test to repeat the test for part (b). Hint: You can use the fact that the order of observations doesn't matter and so any x of length 20 and Ex; = 11 will yield the same result. You should remember to set the alternative to be greater and either subtract 6, from 2 or use mu=0.45. [5] (i) Examine the function power.t.test in R. Create a plot to compare the power of the t-test to the test you have derived across values of 0. Hint: You can calculate the power of the t-test at 0o = 0.45 and 0 = 0.65 using 1 power.t.test(n=n, delta=0.65-0.45,sig.level=0.05, alternative="one sided", sd=sd(x)) $pow for example. Note how this requires the sample standard deviation of x. [5] (j) Write a simulation study to verify your calculation of k using 1000 samples from Ho. [5] (k) Write a simulation study to verify your power curve calculation at DA samples from HA. 0.65 using 1000 (5]
(a) Use Neyman-Pearson's lemma to define the rejection region of the type nī > K (b) Let n = 20, 0, = 0.45, OA 0.65 and Dali 11. Decide whether or not H, should be rejected. Hint: use the fact that nå ~ Bin (n, 0) when Ii iid Bernoulli(0) [5] 1 (c) Using the same values, calculate the p-value. [5] (d) What is the power of the test? [5] (e) Show how the result in (a) can be used to find a test for H, : 0 = 0.45 versus HA: 0 > 0.45. [5] (f) Write down the power function as a function of the parameter of interest. [5] (g) Create an R function to calculate it and plot for 0 € [0,1]. [5]