You are on page 1of 9

How 

to draw a Q‐Q plot for checking the 
validity of your assumed probability 
distribution for the data? 
 

Introduction 
This document illustrates step by step procedure of how to produce a Q‐Q plot to check normality of 
a given set of data. We are using data in “Travel Distance.xlsx” as an example. We assume that the 
data can be modelled by a normal distribution with mean and variance specified by the data 
analysts.    

Procedure 
 

Step 1. Sort data 
We first need to sort the data in ascending order. To do this, highlight (use mouse to select) the 
column of data, and then click “Sort” button on the tool bar. Refer to Figure 1 below: 

 
Figure 1 

On the popup window, choose  “Continue with current selection” option, then click “Sort”. 
 
Step 2. Summary statistics of data 
Use the formula shown in the figure below to calculate some basic measurements of the data: 

 
Step 3. Construct Histogram 
Histogram is the first graphical view to guess what kind of probability distribution that the data 
might follow. Each probability distribution has its unique PDF curve and the histogram of given data 
should approximate the shape of the PDF curve of the probability distribution that it follows.  

To construct the histogram, we need to first decide an appropriate set of bins. For the given data, 
the minimum value is 72.57 and the maximum is 125.48. We can thus define the bins as the 
following: 
 
Now we can use “Histogram” function provided in “Data Analysis Tools” as shown in the screenshot 
below. In order to access this tools, you have to install Data Analysis Toolpak first. 

 
In the popup window, select “Histogram”: 

 
Then specify the range of data and range of bins as shown in the screenshot below. You may play 
around with different options and see what the results are. 
 
A new worksheet will be added with a bar chart drawn: 

 
 

Next, please fine‐tune the bar chart to be a histogram. There are two steps involved: first point your 
cursor to any bar in the chart and right click your mouse to find “Format Data Series…”  

 
The second step is to change “Gap Width” to be 0%. Then a nice histogram will be displayed. 

 
 

The histogram seems to be close to bell‐shaped. We can therefore guess that the data might follow 
normal distribution. However, please note that histogram can be misleading. The look of histogram 
is largely dependent on the bins that you defined. It can only help us to narrow our search of 
probability distribution to fit our data, but cannot be the sole way to determine the probability 
distribution. 

Further to it, normal distribution is not the only probability distribution that is bell‐shaped. Student 
distribution, logistic distribution, etc have similar bell shapes. There are quite a number of methods 
developed to test the normality of data. Q‐Q plot is one of them. In a Q‐Q plot, we compare the 
quantiles of our empirical data with the theoretical data (ideal data that follows exact normal 
distribution) and see how close they are.  

The following steps explain how to construct a Q‐Q plot. 

 
Step 4. Build a Column of Quantiles 
There are several choices of quantiles to be used to construct Q‐Q plot. The simplest of them, given 
a sample size of n, is k/n for k=1, 2, …, n. Other choices include the use of k/(n+1) and (k‐0.5)/n, 
which, by minor adjustment in either the denominator or numerator, very often give better result 
than k/n. In this document, we are going to use (k‐0.5)/n. You may try other choices. 

The following screenshot shows part of quantile column developed. You can copy the formula to the 
whole column. Note that $B$104 refers to the “Count” cell. 
 
 

Step 5. Build a Column of Theoretical Data 
The following screenshot shows the formula of theoretical data, where B102 is mean and B103 is 
standard deviation derived from the given data. 

 
Step 6. Q‐Q Plot 
Select both columns of original data and theoretical data, then insert a scatter plot with them. 

 
 
We are getting something like the following: 

140

120

100

80

60

40

20

0
0.00 20.00 40.00 60.00 80.00 100.00 120.00 140.00
 
As you can see, the data points almost form a straight line. 

Step 7. Fine‐tuning Q‐Q Plot 
There are several things we can do to fine‐tune the Q‐Q plot. 

Option 1. Format axis to be a square plot 
The points are a bit far away from the origin. Visually, it seems just occupying a corner of the graph. 
We can somewhat “zoom in” by formatting the axis. 

a. Click on the y‐axis. 

 
b. Right click on the selected field and then choose “Format Axis”. 
 
c. In the panel popup at the right of Excel worksheet,  
change minimum to 70. 
 
d. Repeat the same for the x‐axis. 
 

We are going to see the following: 

130

120

110

100

90

80

70
70.00 80.00 90.00 100.00 110.00 120.00 130.00
 
 
 
Option 2. Add a 45‐degree line on the scatter plot 
Follow the screenshot below to add a line to the scatter plot. Please go to “INSERT” Ribbon and find 
Shapes. Then add a line to the scatter. 

130

120

110

100

90

80

70
70.00 80.00 90.00 100.00 110.00 120.00 130.00
 
If most of your data points scatter on the 45‐degree line like the chart above, you can conclude that 
your assumed probability distribution is valid to model your sample data. In this application, 
normality assumption on the data is tenable.  

You might also like