I have a dataset which contains about 10000 numbers(class numeric), I want to use QQ plot to see if the data fits the exponential distribution.

This is what I did


and by observation to determine if the exp distribution fits.

Am I right about this?

  • 1
    $\begingroup$ In general, they're not even going to be in the same order. $\endgroup$ – Glen_b Nov 17 '14 at 7:03

That won't work unless your data are sorted.

This works:


(that's essentially what stats:::qnorm.default does to get the two variables in the same order)

There's also an example (the third last one, relating to a chi-square with 3 df) in the help for stats::qqplot that you can easily adapt.

(Also, don't call your data data.)


qqplot will sort the points for you. So you can just call

qqplot(qexp(ppoints(length(data))), data)

  • $\begingroup$ I like the simplicity of this $\endgroup$ – CloudyGloudy Jun 3 '17 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.