Session Ready
Exercise

Exceedance probabilities

Distributions and confidence intervals can be difficult things to present to non-statisticians. An alternative is to present a probability that a value is over a threshold. For example, public health teams might be interested in when an SMR has more than doubled, and as a statistician you can give a probability that this has happened. Then the public health team might decide to go to some alert level when the probability of a doubling of SMR is over 0.95.

Again, the properties of the binomial distribution let you compute this for proportional data. You can then map these exceedance probabilities for some threshold, and use a sensible color scheme to highlight probabilities close to 1.

Instructions
100 XP

The london data set has been loaded, and the expected flu case count, Flu_EXP has been computed.

  • The binom.exceed() function is defined in the sample code. Use it to compute the exceedance probability.

    • Pass it three columns from the london spatial data frame: the observed incidence rate per borough, the total population per borough, and the expected incidence rate per borough.
    • Assign the result to the Flu_gt_2 column of london.
  • Call spplot() to map the exceedance probability.

    • The first argument is the dataset.
    • The second argument is a string naming the column to determine the color.
    • Pass the custom color palette, pal, to col.regions.