Question

In: Statistics and Probability

Question 4. Your friend Joanna is running for class president and has the support of 55%...

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.

Solutions

Expert Solution

 rm(list=ls(all=TRUE)) N=50; x=c(0,1) #Here 1=Jaonna get vote and 0=not vote s=0; votes=0 for(i in 1:10000) { s=sample(x,N,replace = TRUE) votes[i]=sum(s) } length(votes) ## [1] 10000 #votes ##a) p=0.55 p=0.55 z_score=0 for(i in 1:50) { test1=prop.test(votes[i],N,p,alternative = "two.sided",conf.level=0.95) z_score[i]=(test1$statistic) } histogram=hist(z_score) ##b) p=0.6 p=0.6 z_score=0 for(i in 1:50) { test1=prop.test(votes[i],N,p,alternative = "two.sided",conf.level=0.95) z_score[i]=(test1$statistic) } histogram=hist(z_score) ##c) p=0.65 p=0.65 z_score=0 for(i in 1:50) { test1=prop.test(votes[i],N,p,alternative = "two.sided",conf.level=0.95) z_score[i]=(test1$statistic) } histogram=hist(z_score) ##d) p=0.55 |z|>2.575 alpha=0.01 p=0.55 z_score=0 for(i in 1:50) { test1=prop.test(votes[i],N,p,alternative = "two.sided",conf.level=0.99) z_score[i]=(test1$statistic) } histogram=hist(z_score) ##e) p=0.6 p=0.6 z_score=0 for(i in 1:50) { test1=prop.test(votes[i],N,p,alternative = "two.sided",conf.level=0.99) z_score[i]=(test1$statistic) } histogram=hist(z_score) ##f) p=0.65 p=0.65 z_score=0 for(i in 1:50) { test1=prop.test(votes[i],N,p,alternative = "two.sided",conf.level=0.99) z_score[i]=(test1$statistic) } histogram=hist(z_score) 

Related Solutions

Question 4. Your friend Joanna is running for class president and has the support of 55%...
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...
In C++, there are 4 students that are running for class president. Create three arrays: the...
In C++, there are 4 students that are running for class president. Create three arrays: the candidate’s name, the number of votes the candidate receives, and the candidate’s percentage of the total votes. Your program should be broken down into at least 3 functions: find the total number of votes, calculate values for the percentage each candidate received, and sort the number of votes from highest to lowest. Write the candidate’s name, the total number of votes they received, and...
6 a) You and your friend are in a class with 12 students. For a project,...
6 a) You and your friend are in a class with 12 students. For a project, the class is randomly divided into two equal groups. “Randomly” means all divisions are equally likely. What is the probability that you and your friend end up in the same group? 6 b) Revisit part a). Calculate the probability that you and your friend will end up in the same group if the class is divided into three equal groups instead.
1. You are running on campus, collide with the college president, fall, and break your leg...
1. You are running on campus, collide with the college president, fall, and break your leg in three places. Although you are in pain, it is under control. After the president calls for help, she asks you why you aren't in more pain. If you want to answer President Maloney correctly, what is your reply? "It's the endorphins President Maloney." "It's the serotonin President Maloney." "It's the norepinephrine President Maloney." "It's the dopamine President Maloney." "I don't know President Maloney...
Lab: Chapter 4 Discussion Question - Documentation and Informatics 55 unread replies.55 replies. The nurse on...
Lab: Chapter 4 Discussion Question - Documentation and Informatics 55 unread replies.55 replies. The nurse on the surgical intensive care unit is in the process of documenting care for her 38-year-old patient using the electronic health record (EHR). The patient was involved in a motor vehicle accident and suffered a crush injury to her right leg, which has been amputated below the knee. The patient is a single mother to a 5-year-old daughter and works as a waitress. The patient...
Your friend brings a large bag of candy to class. In the bag of candy, there...
Your friend brings a large bag of candy to class. In the bag of candy, there are 34 red candies, 47 blue candies, 23 orange candies, 12 yellow candies, 38 green candies, and 87 purple candies. Using this information answer the questions below: b. Your friend is going to reach into the bag and remove one candy at a time. Before your friend starts removing candies, you want to calculate the probability of selecting candies, in a specific order? (Hint:...
You lend $400,000 to your friend for seven years. According to the agreement, your friend has...
You lend $400,000 to your friend for seven years. According to the agreement, your friend has to repay $89,000 annually for the first four years with a fixed interest rate of 15% compounded annually. Your friend tries to bargain for a 13% charged for the remaining periods. What should be the annual repayment for the last three years?
You have been contacted by your friend, the president of Fun Foods USA, for some advice....
You have been contacted by your friend, the president of Fun Foods USA, for some advice. Fun Foods USA, distributes and markets snack foods that are sold in grocery stores. The firm is organized into geographic subunits: West Coast, Southwest, Southeast, Midwest and Northeast. Each unit has its own production, distribution and marketing functions. The company originally started in the mid-west but grew over the years by acquiring local snack food companies that catered to the local market: for example,...
Case Study The President of LFC Inc, Jo Rogers, a friend of your family, recently hired...
Case Study The President of LFC Inc, Jo Rogers, a friend of your family, recently hired you as a trainee executive assistant. Your duties include assisting with strategy, budgeting, and year-end accounts. On 1st Dec 2020 at the end of the financial year, Jo calls by your office. S/he greets you with a warm friendly smile and says s/he is pleased with your work so far and can see how you can play an important part in its future expansion....
1.Your friend brings a large bag of candy to class. In the bag of candy, there...
1.Your friend brings a large bag of candy to class. In the bag of candy, there are 13 red candies, 20 blue candies, 13 orange candies, 5 yellow candies, 40 green candies, and 61 purple candies. b.Your friend is going to reach into the bag and remove one candy at a time. Before your friend starts removing candies, you want to calculate the probability of selecting candies, in a specific order? (each time a candy is removed from the bag,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT