In: Statistics and Probability
Question 4. Your friend Joanna is running for class president and has the support of 55% of the total student body. You poll a group of N students (N=50 or N=150) and compute the total number of students who state that they will vote for Joanna. For samples of size N=50 or N=150, use R to simulate 10,000 independent samples and record the total votes for Joanna in each sample. For each sample, compute a Z-score test statistic for the specified null hypothesis and α given below.
Compute the following (a-f) for both N=50 and N=150 separately.
a) Plot a histogram of the resulting Z-score distribution under H0: p=0.55. Based on a rejection region of |Z|>1.96, does the simulated Type I error probability match the expected Type I error probability (α).
b) Plot a histogram of the resulting Z-score distribution under H0: p=0.6. Based on a rejection region of |Z|>1.96, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).
c) Plot a histogram of the resulting Z-score distribution under H0: p=0.65. Based on a rejection region of |Z|>1.96, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).
d) Plot a histogram of the resulting Z-score distribution under H0: p=0.55. Based on a rejection region of |Z|>2.575, does the simulated Type I error probability match the expected Type I error probability (α).
e) Plot a histogram of the resulting Z-score distribution under H0: p=0.6. Based on a rejection region of |Z|>2.575, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).
f) Plot a histogram of the resulting Z-score distribution under H0: p=0.65. Based on a rejection region of |Z|>2.575, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).
g) What factors (N, α, |?0 − ??|) (if any) influence the Type I error probability? Explain.
h) What factors (N, α, |?0 − ??|) (if any) influence the Type II error probability? Explain.