Exercise

Exercise 1 - Confidence Intervals of Polling Data

For each poll in the polling data set, use the CLT to create a 95% confidence interval for the spread. Create a new table called cis that contains columns for the lower and upper limits of the confidence intervals.

Instructions

100 XP
  • Use pipes %>% to pass the poll object on to the mutate function, which creates new variables.
  • Create a variable called X_hat that contains the estimate of the proportion of Clinton voters for each poll.
  • Create a variable called se that contains the standard error of the spread.
  • Calculate the confidence intervals using the qnorm function and your calculated se.
  • Use the select function to keep the following columns: state, startdate, enddate, pollster, grade, spread, lower, upper.