I'm going through the Harvard Data Science Course (CS 109), and at one point, when trying to model the 2008 election, the instructor says:

Compute the number of votes at the 5th and 95th quantiles, and display the difference (this is an estimate of the outcome's uncertainty)

Could someone please explain how computing these quantiles would help determine uncertainty. What does uncertainty even mean in this context?



I am trying to generate a model to predict the 2008 election based on polling data. Here is the hist that I created enter image description here

  • $\begingroup$ Context would help. What are these quantiles of? Are we generating predictions or something? $\endgroup$
    – Glen_b
    Jul 25, 2017 at 0:12
  • $\begingroup$ Edited for context $\endgroup$
    – bugsyb
    Jul 25, 2017 at 0:18

1 Answer 1


The difference between the 5th and 95th percentiles will be proportional to the standard deviation of your data. This is because it's a rough estimate of how much your simulation results vary from one simulation to the next.

It looks like you've run a simulation to determine how many electoral votes Obama would receive in the election. Under the assumptions of this model, at the 5th quantile, the chances of receiving that many electoral votes or fewer is roughly 5 percent. Similarly, at the 95th percentile, the chances of receiving that many electoral votes or greater is also roughly 5 percent.

Therefore, with 90 percent confidence, the result of the simulation (and the actual result of the election if your model is accurate), will be a total number of electoral votes between the 5th and 95th quantiles. In this way, you've generated an empirical 90% confidence interval for the total number of votes Obama receives.

Also, if you compute the percentage of simulations for which the number of electoral votes falls below the victory threshold, then this gives you the probability under your model that Obama will lose the election.

  • $\begingroup$ The opening sentence asserting proportionality to the standard deviation is a bit of a distraction here. The difference between paired quantiles is just one of many measures of spread or variability. Whether and how well it indicates the SD is a different question. $\endgroup$
    – Nick Cox
    Dec 23, 2022 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.