# Suggestion for qqplot() improvement

**Martin Maechler
**
Martin Maechler <maechler@stat.math.ethz.ch>

*Tue, 31 Aug 1999 15:42:48 +0200*

>>>>>* On Tue, 31 Aug 1999 14:57, Werner Stahel <stahel@stat.math.ethz.ch> said:
*
WSt> Here is a suggestion. It seems that qqplots, comparing a sample
WSt> to a distribution other than the normal, are not explicitly
WSt> available in S or R. I found
(in S-plus / Trellis it is, see below)
WSt> qqplot(y, rt(300, df = 5))
WSt> as an example in the help file to qqplot .
WSt> This is not very sensible.
(it only tried to show that you can QQ-plot two datasets
of *different* length, rather than anything else)
WSt> I would prefer
WSt> n <- length(y)
WSt> qqplot(qt((1:n)/(n+1), df=5), y, xlab='quantiles', ylab='data')
yes, for comparison with a theoretical distribution.
Maybe even
qqplot(qt(ppoints(n), df=5), y,
xlab='quantiles of t(* ,df=5)', ylab='data')
WSt> and this could be shortened to
WSt> qqplot(y, distribution='t', df=5)
WSt> with an easy extension of the function.
I found:
Trellis in S-plus has
qqmath(formula, distribution = qnorm, f.value = ppoints, ...),
for your example
qqmath( ~ y, distribution = function(p) qt(p, df=5), ...)
which is slightly more general (also works with panels, banking to 45
deg,..) but quite a bit more complicated to use for non-sophisticated users.
What should we do / would we want for R?
Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._