Q – Q Plots

update :

Q-Q plots can be used to test goodness of fit for any distribution. There are p-p plots and other method as well.

https://stats.stackexchange.com/questions/132652/how-to-determine-which-distribution-fits-my-data-best

There is also a P-P plot.

https://en.wikipedia.org/wiki/P%E2%80%93P_plot


Since few days I was coming across to Q-Q plots very often and thought to learn more about it.

Full form is Quartile-Quantile plot.

Many a times we want our data to be normal, this is because we normality is an assumption behind many statistical models. Now how to test normality. Wikipedia has an article about this which lists many method, one of them is Q-Q plots.

Here is how to create Q-Q plot manually (This steps will show the theory behind it):

  1. Sort your samples (Call it Y). Let n be no of sample. n = len(Y)
  2. Find n values(quartiles) from standard normal distribution to divide it in (n+1) equal areas
    1. Standard normal distribution is a distribution with mean = 0 and standard deviation = 1
  3. Call above X
  4. Plot Y against X
  5. For normal distribution it would be approximately straight line
    1. However considering probability, outliers and no of smaples have role to play

Here is the example code and plots in pythons:

maxresdefaultSnLhAm

Reference :

  1. You tube video 

Leave a comment