Quantile-Quantile (QQ) Plots

I understand how to assess whether an exponential/normal distribution is suitable to model a piece of data when the parameters are given, i.e. finding the theoretical quantiles and plotting against the sample quantiles. However when the parameters aren't given e.g. for exponential, lambda is unknown then how would you find theoretical qunatiles, and the same for the normal distribution too?

• I believe the parameter is estimated and it's plotted against what the theoretical quantities would be given that parameter. – badatmath Feb 8 at 16:38

The short answer is that you get the theoretical quantiles from the standard normal distribution $$(\mu =0, \sigma=1)$$ or the standard exponential distribution $$(\lambda = 1).$$

The fundamental idea is that you're judging whether the Q-Q plot is essentially linear. You don't need to know the equation of the line in order to judge linearity. However, if you do know the parameter(s), then you can know the equation of the line. And by estimating parameter(s) you may be able to get a good approximation of the equation.

Default Q-Q plots in R put the theoretical quantiles on the horizontal axis and the quantiles of the data on the vertical axis. In North America, perhaps it is more common to put the quantiles of the data on the horizontal axis; in the graphical qqnorm you can use the parameter datax=T to do this. For easier comparison with a plot of the empirical CDF, I will put data on the horizontal axis in my examples.

The ECDF of a sample puts probability $$1/n$$ at each data value; if $$k$$ observations are tied at a single value, then the probability of that value is $$k/n.$$ For sufficiently large samples the ECDF of the sample closely matches the CDF of the population distribution.

Normal example. Generate a sample of size $$n = 1000$$ and make a normal Q-Q plot.

set.seed(1902)           # for reproducibility
x = rnorm(1000, 100, 15) # mean 100, SD 15
par(mfrow=c(1,2))        # enable 2 plots per panel
plot(ecdf(x))
qqnorm(x, datax=T)
abline(a=-100/15, b=1/15, col="green", lwd=3, lty="dotted")
par(mfrow=c(1,1))        # resume single-plot mode In the ECDF plot at left, the black ECDF values nearly match the dotted green CDF values for $$\mathsf{Norm}(\mu=100,\sigma=15).$$ In the Q-Q plot at right, the vertical scale has been distorted so that the CDF becomes a straight line $$y = -\frac{\mu}{\sigma} + \frac{1}{\sigma}x.$$

Even when data are precisely from a particular distribution, you should not expect all data points at the extremes of the sample to fall really near to the straight line corresponding to that distribution.

Exponential example. R has no built-in function for making exponential Q-Q plots, but making them is not difficult. I am using a method suggested by one of the answers on our stat site. The data are from an exponential distribution with rate $$\lambda = 3$$ (thus mean $$\mu = 1/3).$$

set.seed(208)
x = rexp(1000, rate=3) # mean= 1/3, rate = 3
par(mfrow=c(1,2))        # enable 2 plots per panel
plot(ecdf(x)); Again here the ECDF very nearly matches the exponential CDF and the the line $$y = \lambda x$$ is a distorted version of the CDF.