Description Usage Arguments Details Value Author(s) References See Also Examples
We generalize function qqplot
from package stats to
be applicable to distribution objects. In this context,
qqplot
produces a QQ plot of two distributions, i.e.; argument x
is the distribution to be checked for compatibility, and y
is the
model (H0)distribution.
Graphical parameters may be given as arguments to qqplot
.
The stats function
is just the method for signature x=ANY,y=ANY
.
In all title and axis label arguments, if withSubst
is TRUE
,
the following patterns are substituted:
"%C"
class of argument x
"%A"
deparsed argument x
"%D"
time/datestring when the plot was generated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  qqplot(x, y, ...)
## S4 method for signature 'UnivariateDistribution,UnivariateDistribution'
qqplot(x, y,
n = 30, withIdLine = TRUE, withConf = TRUE,
withConf.pw = withConf, withConf.sim = withConf,
plot.it = TRUE, xlab = deparse(substitute(x)),
ylab = deparse(substitute(y)), ...,
width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
mfColRow = TRUE, n.CI = n, col.IdL = "red", lty.IdL = 2, lwd.IdL = 2,
alpha.CI = .95, exact.pCI = (n<100), exact.sCI = (n<100), nosym.pCI = FALSE,
col.pCI = "orange", lty.pCI = 3, lwd.pCI = 2, pch.pCI = par("pch"),
cex.pCI = par("cex"),
col.sCI = "tomato2", lty.sCI = 4, lwd.sCI = 2, pch.sCI = par("pch"),
cex.sCI = par("cex"),
cex.pch = par("cex"), col.pch = par("col"),
jit.fac = 0, check.NotInSupport = TRUE,
col.NotInSupport = "red", with.legend = TRUE, legend.bg = "white",
legend.pos = "topleft", legend.cex = 0.8, legend.pref = "",
legend.postf = "", legend.alpha = alpha.CI, debug = FALSE, withSubst = TRUE)
## S4 method for signature 'ANY,ANY'
qqplot(x, y,
plot.it = TRUE, xlab = deparse(substitute(x)),
ylab = deparse(substitute(y)), ...)

x 
object of class 
y 
object of class 
n 
numeric; number of quantiles at which to do the comparison. 
withIdLine 
logical; shall line 
withConf 
logical; shall confidence lines be plotted? 
withConf.pw 
logical; shall pointwise confidence lines be plotted? 
withConf.sim 
logical; shall simultaneous confidence lines be plotted? 
plot.it 
logical; shall be plotted at all (inherited from 
xlab 
xlabel 
ylab 
ylabel 
... 
further parameters for function 
width 
width (in inches) of the graphics device opened 
height 
height (in inches) of the graphics device opened 
withSweave 
logical: if 
mfColRow 
shall default partition in panels be used — defaults to 
n.CI 
numeric; number of points to be used for confidence interval 
col.IdL 
color for the identity line 
lty.IdL 
line type for the identity line 
lwd.IdL 
line width for the identity line 
alpha.CI 
confidence level 
exact.pCI 
logical; shall pointwise CIs be determined with exact Binomial distribution? 
exact.sCI 
logical; shall simultaneous CIs be determined with exact kolmogorov distribution? 
nosym.pCI 
logical; shall we use (shortest) asymmetric CIs? 
col.pCI 
color for the pointwise CI 
lty.pCI 
line type for the pointwise CI 
lwd.pCI 
line width for the pointwise CI 
pch.pCI 
symbol for points (for discrete mass points) in pointwise CI 
cex.pCI 
magnification factor for points (for discrete mass points) in pointwise CI 
col.sCI 
color for the simultaneous CI 
lty.sCI 
line type for the simultaneous CI 
lwd.sCI 
line width for the simultaneous CI 
pch.sCI 
symbol for points (for discrete mass points) in simultaneous CI 
cex.sCI 
magnification factor for points (for discrete mass points) in simultaneous CI 
cex.pch 
magnification factor for the plotted symbols 
col.pch 
color for the plotted symbols 
jit.fac 
jittering factor used for discrete distributions 
check.NotInSupport 
logical; shall we check if all 
col.NotInSupport 
logical; if preceding check 
with.legend 
logical; shall a legend be plotted? 
legend.bg 
background color for the legend 
legend.pos 
position for the legend 
legend.cex 
magnification factor for the legend 
legend.pref 
character to be prepended to legend text 
legend.postf 
character to be appended to legend text 
legend.alpha 
nominal coverage probability 
debug 
logical; if 
withSubst 
logical; if 
signature(x = "ANY", y = "ANY")
: function qqplot
from
package stats.
signature(x = "UnivariateDistribution", y = "UnivariateDistribution")
:
produces a QQ plot for two univariate distributions.
A list of elements containing the information needed to compute the
respective QQ plot, in particular it extends the elements of the
return value of function qqplot
from package stats, i.e., a
list with components x
and y
for x and y coordinates
of the plotted points; more specifically it contains
x 
The x coordinates of the points that were/would be plotted 
y 
The corresponding quantiles of the second distribution,
including 
crit 
A matrix with the lower and upper confidence bounds
(computed by 
err 
logical vector of length 2. 
(elements crit
and err
are taken from the return
value(s) of qqbounds
).
The return value allows to recover all information used to produce the plot
for later use in enhanced graphics (e.g. with ggplot).
Peter Ruckdeschel [email protected]
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
qqplot
from package stats – the standard QQ plot
function and
qqbounds
, used by qqplot
to produce confidence
intervals.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  qqplot(Norm(15,sqrt(30)), Chisq(df=15))
## some discrete Distributions:
P < Pois(5)
B < Binom(size=2000,prob=5/2000)
qqplot(B,P)
## Not run:
## takes too much time for R CMD check ascran
qqplot(B,P, nosym.pCI=TRUE)
## End(Not run)
## some LebesgueDecomposed distributions:
mylist < UnivarLebDecDistribution(discretePart=Binom(3,.3), acPart=Norm(2,2),
acWeight=11/20)
mylist2 < mylist+0.1
qqplot(mylist,mylist2)
qqplot(mylist,mylist2,exact.pCI=FALSE,exact.sCI=FALSE)
## Not run:
## takes too much time for R CMD check ascran
qqplot(mylist,mylist2,nosym.pCI=TRUE)
## some ac. distribution with a gap
mylist3 < UnivarMixingDistribution(Unif(0,0.3),Unif(0.6,1),mixCoeff=c(0.8,0.2))
gaps(mylist3)
mylist4 < UnivarMixingDistribution(Unif(0,0.3),Unif(0.6,1),mixCoeff=c(0.6,0.4))
qqplot(mylist3,mylist4)
qqplot(mylist3,mylist4,nosym.pCI=TRUE)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.