qqplot (Quantile-Quantile Plot) in Python
When the quantiles of two variables are plotted against each other, then the plot obtained is known as quantile – quantile plot or qqplot. This plot provides a summary of whether the distributions of two variables are similar or not with respect to the locations.
- All point of quantiles lie on or close to straight line at an angle of 45 degree from x – axis. It indicates that two samples have similar distributions.
And in practice it is always not possible to get such a 100 percent clear straight line but the plot looks like below. Here the points are lying nearly on the straight line.
- The y – quantiles are lower than the x – quantiles. It indicates y values have a tendency to be lower than x values.
And in practice it is not always possible to get 100 percent as shown above but the plot looks as shown below. Here you can see that most of the points are lying below the line and few points are above the line. Hence we can say that the distributions are not the same.
- The x – quantiles are lower than the y – quantiles. It indicates x values have a tendency to be lower than the y values.
- Indicates that there is a breakpoint up to which the y – quantiles are lower than the x – quantiles and after that point the y – quantiles are higher than the x – quantiles.
Quantile – Quantile plot using
statsmodel in Python –
Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the Machine Learning Foundation Course at a student-friendly price and become industry ready.