A *quanitle-quantile plot* (also
called a *q-q plot*) visually assesses whether
sample data comes from a specified distribution. Alternatively, a
q-q plot assesses whether two sets of sample data come from the same
distribution.

A q-q plot orders the sample data values from smallest to largest,
then plots these values against the expected value for the specified
distribution at each quantile in the sample data. The quantile values
of the input sample appear along the *y*-axis, and
the theoretical values of the specified distribution at the same quantiles
appear along the *x*-axis. If the resulting plot
is linear, then the sample data likely comes from the specified distribution.

The q-q plot selects quantiles based on the number of values
in the sample data. If the sample data contains *n* values,
then the plot uses *n* + 1 quantiles.
Plot the *i*th ordered value (also called the *i*th *order
statistic*) against the $$\frac{i}{(n+1)}$$th
quantile of the specified distribution.

A q-q plot can also assesses whether two sets of sample data
have the same distribution, even if you do not know the underlying
distribution. The quantile values for the first data set appear on
the *x*-axis and the corresponding quantile values
for the second data set appear on the *y*-axis. Since
q-q plots rely on quantiles, the number of data points in the two
samples does not need to be equal. If the sample sizes are unequal,
the q-q plot chooses the quantiles based on the smaller data set.
If the resulting plot is linear, then the two sets of sample data
likely come from the same distribution.