Exercise

Q-Q plot

Another way to examine the normality of a distribution is with a Q-Q (quantile-quantile) plot. For this exercise, you will create a Q-Q plot for the country-level Unemployment data you saw in the last exercise (available in your workspace as countrydata). The Q-Q plot compares the theoretical quantiles expected under a normal distribution to the actual observed values (ordered). When a distribution is normally distributed, you will see a straight line. The more crooked the line is, the farther the distribution departs from normality. pandas and scipy.stats have been loaded into the workspace as pd and stats.

Instructions

100 XP
  • Calculate the theoretical quantiles for a normal distribution.
  • Create a DataFrame including your theoretical quantiles and the ordered values for Unemployment.
  • Create and print a Q-Q plot using your DataFrame.