How can I generate an exponential Q-Q plot in R?

r, statistics

Solution

EDIT (To reflect @Dason's input).

Like this:

set.seed(1)          # for reproducibility 
Z <- rexp(1000)      # random sample from exponential distribution
p <- ppoints(100)    # 100 equally spaced points on (0,1), excluding endpoints
q <- quantile(Z,p=p) # percentiles of the sample distribution
plot(qexp(p) ,q, main="Exponential Q-Q Plot",
     xlab="Theoretical Quantiles",ylab="Sample Quantiles")
qqline(q, distribution=qexp,col="blue", lty=2)

Problem

how can I generate an exponential Q-Q plot in R? For a normal Q-Q plot I use ``` qqnorm(sample) ```

Original source