Exercise

# Exercise 3 - Stratify by Pollster and Grade

Now find the proportion of hits for each pollster. Show only pollsters with at least 5 polls and order them from best to worst. Show the number of polls conducted by each pollster and the FiveThirtyEight grade of each pollster.

Instructions

**100 XP**

- Create an object called
`p_hits`

that contains the proportion of intervals that contain the actual spread using the following steps. - Use the
`mutate`

function to create a new variable called`hit`

that contains a logical vector for whether the`actual_spread`

falls between the`lower`

and`upper`

confidence intervals. - Use the
`group_by`

function to group the data by pollster. - Use the
`filter`

function to filter for pollsters that have at least 5 polls. - Summarize the proportion of values in
`hit`

that are true as a variable called`proportion_hits`

. Also create new variables for the number of polls by each pollster (`n`

) using the`n()`

function and the grade of each poll (`grade`

) by taking the first row of the grade column. - Use the
`arrange`

function to arrange the`proportion_hits`

in descending order.