Member-only story

CS(16) Quantile-Quantile (Q-Q) Plots

Carla Martins
5 min readDec 3, 2024

--

The Quantile-Quantile (Q-Q) plots provide a graphical method for assessing whether a dataset follows a specified distribution. Q-Q plots are widely used in computational statistics and data analysis to visually compare the quantiles of two distributions: the observed data and the theoretical quantiles of a reference distribution. If the data approximately follow the reference distribution, the points in Q-Q plots will align along a straight line.

Understanding Q-Q Plots

Quantiles are cutpoints that divide a dataset into intervals containing equal proportions of the data. For a given probability p, the p-quantile of a distribution is the value below which p x 100% of the data lies. A Q-Q plot compares the quantiles of two distributions by plotting:

  1. The empirical quantiles of the observed dataset on the y-axis.
  2. The theoretical quantiles of the reference distribution on the x-axis.

If the observed data match the theoretical distribution, the points lie close to the y = x line. Deviations from this line indicate discrepancies between the data and the model.

Creating Q-Q Plots in R

R provides two primary functions for generating Q-Q plots:

  1. qqnorm() for comparing data to a normal

--

--

Carla Martins
Carla Martins

Written by Carla Martins

Compulsive learner. Passionate about technology. Speaks C, R, Python, SQL, Haskell, Java and LaTeX. Interested in creating solutions.

No responses yet