Question: How do I do Question 2 without using the tapply function? 2.The mere existence of high frequencies at low fractions may not imply election fraud.
How do I do Question 2 without using the tapply function?
2.The mere existence of high frequencies at low fractions may not imply election fraud. Indeed, more numbers are divisible by smaller integers like 2, 3, and 4 than by larger integers like 22, 23, and 24.
To investigate the possibility that the low fractions arose by chance, assume the following probability model. The turnout for a precinct has a binomial distribution, whose size equals the number of voters and success probability equals the turnout rate for the precinct. The vote share for United Russia in this precinct is assumed to follow a binomial distribution, conditional on the turnout, where the size equals the number of voters who turned out and the success probability equals the observed vote share in the precinct.
Conduct a Monte Carlo simulation under this alternative assumption (1000 simulations should be sufficient). What are the 10 most frequent vote share values? Create a histogram similar to the one in the previous question. Briefly comment on the results you obtain.
Note: This question requires a computationally intensive code. Write a code with a small number of simulations first and then run the final code with 1000 simulations.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
