38.6k views
3 votes
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, ...,21} where xi = 1 with probability and Xi = 0) with probability 1-0. Define the hypotheses H. : 0 = 0, and HA: 0 = 0 A, and assume a = 0.05 and 0< 04. (a) Use Neyman-Pearson's lemma to define the rejection region of the type no > K (b) Let n = 20, 0o = 0.45, 0 A = 0.65 and 2-1 (i = 11. Decide whether or not H, should be rejected. Hint: use the fact that nX ~ Bin (n. 6) when Ii ind Bernoulli(). [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]

1 Answer

5 votes

(a) According to Neyman-Pearson's lemma, the rejection region of the type I error rate (α) for testing H0: θ = θ0 against HA: θ = θA, where θ0 < θA, is given by:

{X: f(x; θA) / f(x; θ0) > k}

where f(x; θ) is the probability mass function (PMF) of the distribution of the data, given the parameter θ, and k is chosen such that the type I error rate is α.

For this problem, we have H0: p = 0 and HA: p > 0.4, with α = 0.05. Therefore, we need to find the value of k such that P(X ∈ R | H0) = α, where R is the rejection region.

Using the fact that X follows a binomial distribution with n trials and success probability p, we have:

f(x; p) = (n choose x) * p^x * (1-p)^(n-x)

Then, the likelihood ratio is:

L(x) = f(x; pA) / f(x; p0) = (pA / p0)^x * (1-pA / 1-p0)^(n-x)

We want to find k such that:

P(X ∈ R | p = p0) = P(L(X) > k | p = p0) = α

Using the distribution of L(X) under H0, we have:

P(L(X) > k | p = p0) = P(X > k') = 1 - Φ(k')

where Φ is the cumulative distribution function (CDF) of a standard normal distribution, and k' is the value of k that satisfies:

(1 - pA / 1 - p0)^(n-x) = k'

k' can be found using the fact that X ~ Bin(n, p0) and P(X > k') = α, which yields:

k' = qbinom(α, n, 1-pA/1-p0)

Therefore, the rejection region R is given by:

R = {X: X > qbinom(α, n, 1-pA/1-p0)}

(b) We have n = 20, p0 = 0.45, pA = 0.65, and X = 11. Using the rejection region R defined in part (a), we have:

R = {X: X > qbinom(0.05, 20, 1-0.65/1-0.45)} = {X: X > 12}

Since X = 11 is not in R, we fail to reject H0 at the 5% level of significance.

(c) The p-value is the probability of observing a test statistic as extreme as the one computed from the data, assuming H0 is true. For this problem, the test statistic is X = 11, and we want to find the probability of observing a value as extreme or more extreme than 11, under the null hypothesis H0: p = 0. Using the binomial distribution with p = 0.45, we have:

p-value = P(X >= 11 | p = 0) = 1 - P(X <= 10 | p = 0)

= 1 - pbinom(10, 20, 0.45)

= 0.151

Therefore, the p-value is 0.151, which is greater than the level of significance α = 0.05, so we fail to reject H0.

User NoobieNoob
by
8.6k points