Q-Q Plots Explained | Built In (2024)

In statistics, Q-Q (quantile-quantile) plots play a vital role in graphically analyzing and comparing two probability distributions by plotting their quantiles against each other. If the two distributions that we are comparing are exactly equal, then the points on the Q-Q plot will perfectly lie on a straight line y = x.Yes, its just that simple.

As a data scientist or a statistician in general, you need to know whether or not the distribution is normal so you can apply various statistical measures to the data and interpret it with much more human-understandable visualizations.

This is where Q-Q plots come into the picture. The most fundamental question answered by Q-Q plot is this:Is this curve normally distributed? For example, this curve is normally distributed. But why?

Q-Q plots are used to find the type of distribution for a random variable whether it be a Gaussian distribution, uniform distribution, exponential distribution or even a Pareto distribution. You can tell the type of distribution using the power of the Q-Q plot just by looking at it. In general, we are talking about normal distributions only because we have a beautiful concept called the 68–95–99.7 rule, which perfectly fits into the normal distribution. Thanks to this, we know how much of the data lies in the range of first, second, and third standard deviation from the mean. So, knowing whether a distribution is normal or not opens up new doors for us to easily experiment with the data. Further, normal distributions occur frequently in most natural events that have a vast scope.

What is a Q-Q Plot?

Q-Q (quantile-quantile) plots play a vital role in graphically analyzing and comparing two probability distributions by plotting their quantiles against each other. If the two distributions that we are comparing are exactly equal, then the points on the Q-Q plot will perfectly lie on a straight line y = x.A Q-Q plot tells us whether a data set is normally distributed.

More in Data ScienceHow to Implement Binary Search in Python

How Does a Q-Q Plot Work?

We plot the theoretical quantiles, basically known as the standard normal variate (a normal distribution with mean of zero and a standard deviation of one) on the x-axis and the ordered values for the random variable, which we want to determine whether or not is a Gaussian distribution, on the y-axis. This gives a beautiful and smooth straight-line-like structure from each point plotted on the graph.

Now, we have to focus on the ends of the straight line. If the points at the ends of the curve formed from the points are not falling on a straight line but are scattered significantly from these positions, then we cannot conclude a relationship between the x- and y-axes. This result clearly signifies that the ordered values that we wanted to calculate are not normally distributed.

If all the points plotted on the graph perfectly lie on a straight line, then we can clearly say that this distribution is normal because it is evenly aligned with the standard normal variate, which is the simple concept of Q-Q plot.

What Are Skewed Q-Q Plots?

Q-Q plots are also used to find the skewness (a measure of asymmetry) of a distribution. When we plot theoretical quantiles on the x-axis and the sample quantiles whose distribution we want to know on the y-axis, then we see a very peculiar shape of a normally distributed Q-Q plot for skewness. If the bottom end of the Q-Q plot deviates from the straight line but the upper end does not, then we can clearly say that the distribution has a longer tail to its left. Put another way, it is left-skewed, also callednegatively skewed. When we see the upper end of the Q-Q plot deviate from a straight line while the lower follows one, then the curve has a longer tail to its right and it is right-skewed, also called positively skewed.

What Are Tailed Q-Q Plots?

Similarly, we can talk about the kurtosis (a measure of “tailedness”) of the distribution by simply looking at its Q-Q plot. The distribution with a fat tail will have both ends of the Q-Q plot deviate from the straight line while its center follows a straight line. By contrast, a thin-tailed distribution will form a Q-Q plot with very little or negligible deviation at the ends, thus making it a perfect fit for the normal distribution.

How Much Data Do We Need for a Q-Q Plot?

Note that when the data points are few, the Q-Q plot does not perform very precisely, and it fails to give a conclusive answer. When we have an ample amount of data points and plot a Q-Q plot using a large data set, however, then it gives a result significant enough to draw clear conclusions about the type of distribution.

Grow Your Data Science SkillsWhat Is a Function in Python?

Q-Q Plots Implementation Examples in Python

Here is a simple implementation of plotting a Q-Q plot in Python.

import numpy as np import statsmodels.api as sm import pylab as py # np.random generates different random numbers everytime the code is executed.data_points = np.random.normal(0, 1, 100) sm.qqplot(data_points, line ='45') py.show()

Another Implementation of the Q-Q plot using the Scipy library.

import scipy.stats as statsimport numpy as npimport matplotlib.pyplot as plt%matplotlib inlinen = 2000observation = np.random.binomial(n, 0.53, size = 1000)/n# standardize the observationz = (observation-np.mean(observation))/np.std(observation)stats.probplot(z, dist="norm", plot=plt)plt.title("Normal Q-Q plot")plt.show()
Q-Q Plots Explained | Built In (2024)

References

Top Articles
100 Clean Eating Recipes, The Best Tasting Recipes, Ever!
Best Mochi Donuts Recipe - Simply Bakings
Craigslist Myrtle Beach Motorcycles For Sale By Owner
Bubble Guppies Who's Gonna Play The Big Bad Wolf Dailymotion
Dee Dee Blanchard Crime Scene Photos
Jonathan Freeman : "Double homicide in Rowan County leads to arrest" - Bgrnd Search
True Statement About A Crown Dependency Crossword
Bubbles Hair Salon Woodbridge Va
[2024] How to watch Sound of Freedom on Hulu
Spelunking The Den Wow
Oscar Nominated Brings Winning Profile to the Kentucky Turf Cup
Koop hier ‘verloren pakketten’, een nieuwe Italiaanse zaak en dit wil je ook even weten - indebuurt Utrecht
The Banshees Of Inisherin Showtimes Near Regal Thornton Place
Inter-Tech IM-2 Expander/SAMA IM01 Pro
Foxy Brown 2025
Forest Biome
Cbssports Rankings
Evil Dead Rise Showtimes Near Pelican Cinemas
Reser Funeral Home Obituaries
Silky Jet Water Flosser
BJ 이름 찾는다 꼭 도와줘라 | 짤방 | 일베저장소
Albert Einstein Sdn 2023
Klsports Complex Belmont Photos
Mta Bus Forums
Xxn Abbreviation List 2017 Pdf
Cal State Fullerton Titan Online
Anesthesia Simstat Answers
Ryujinx Firmware 15
Ripsi Terzian Instagram
Mrstryst
Nicole Wallace Mother Of Pearl Necklace
Final Exam Schedule Liberty University
Dallas City Council Agenda
Craigslist Lakeside Az
Hell's Kitchen Valley Center Photos Menu
Stafford Rotoworld
Heelyqutii
Colorado Parks And Wildlife Reissue List
Questions answered? Ducks say so in rivalry rout
Rocky Bfb Asset
Ucla Basketball Bruinzone
Chr Pop Pulse
Tacos Diego Hugoton Ks
Human Resources / Payroll Information
Bridgeport Police Blotter Today
Theatervoorstellingen in Nieuwegein, het complete aanbod.
Identogo Manahawkin
Craigslist Charles Town West Virginia
Used Auto Parts in Houston 77013 | LKQ Pick Your Part
Sam's Club Fountain Valley Gas Prices
Taterz Salad
Anthony Weary Obituary Erie Pa
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 5927

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.