Question
Overview In June 2016, the United Kingdom (UK) held a referendum to determine whether the country would Remain in the European Union (EU) or Leave
Overview
In June 2016, the United Kingdom (UK) held a referendum to determine whether the country would "Remain" in the European Union (EU) or "Leave" the EU. This referendum is commonly known as Brexit. Although the media and others interpreted poll results as forecasting "Remain" (p>0.5)
, the actual proportion that voted "Remain" was only 48.1%(p=0.481)
and the UK thus voted to leave the EU. Pollsters in the UK were criticized for overestimating support for "Remain".
In this project, you will analyze real Brexit polling data to develop polling models to forecast Brexit results. Youwill write your own code in R and enter the answers on the edX platform.
Important definitions
Data Import
Import thebrexit_pollspolling data from thedslabspackage and set options for the analysis:
# suggested libraries and options library(tidyverse) options(digits = 3) # load brexit_polls object library(dslabs) data(brexit_polls)
Final Brexit parameters
Definep=0.481
as the actual percent voting "Remain" on the Brexit referendum andd=2p1=0.038
as the actual spread of the Brexit referendum with "Remain" defined as the positive outcome:
p <- 0.481 # official proportion voting "Remain" d <- 2*p-1 # official spread
Question 1: Expected value and standard error of a poll
0.0/6.0 points (graded)
The final proportion of voters choosing "Remain" wasp=0.481
. Consider a poll with a sample ofN=1500
voters.
What is the expected total number of voters in the sample choosing "Remain"?
What is the standard error of the total number of voters in the sample choosing "Remain"?
What is the expected value ofX
^
, the proportion of "Remain" voters?
What is the standard error ofX
^
, the proportion of "Remain" voters?
What is the expected value ofd
, the spread between the proportion of "Remain" voters and "Leave" voters?
What is the standard error ofd
, the spread between the proportion of "Remain" voters and "Leave" voters?
Question 2: Actual Brexit poll estimates
0.0/4.0 points (graded)
Load and inspect thebrexit_pollsdataset fromdslabs, which contains actual polling data for the 6 months before the Brexit vote. Raw proportions of voters preferring "Remain", "Leave", and "Undecided" are available (remain,leave,undecided) The spread is also available (spread), which is the difference in the raw proportion of voters choosing "Remain" and the raw proportion choosing "Leave".
Calculatex_hatfor each poll, the estimate of the proportion of voters choosing "Remain" on the referendum day (p=0.481
), given the observedspreadand the relationshipd
^
=2X
^
1
. Usemutate()to add a variablex_hatto thebrexit_pollsobject by filling in the skeleton code below:
brexit_polls <- brexit_polls %>% mutate(x_hat = __________)
What is the average of the observed spreads (spread)?
What is the standard deviation of the observed spreads?
What is the average ofx_hat, the estimates of the parameterp
?
What is the standard deviation ofx_hat?
Question 3: Confidence interval of a Brexit poll
Consider the first poll inbrexit_polls, a YouGov poll run on the same day as the Brexit referendum:
brexit_polls[1,]
Useqnorm()to compute the 95% confidence interval forX
^
What is the lower bound of the 95% confidence interval?
What is the upper bound of the 95% confidence interval?
Does the 95% confidence interval predict a winner (does not coverp=0.5
)? Does the 95% confidence interval cover the true value ofp
observed during the referendum?
The interval predicts a winner and covers the true value ofp.
The interval predicts a winner but does not cover the true value ofp.
The interval does not predict a winner but does cover the true value ofp.
The interval does not predict a winner and does not cover the true value ofp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started