distr (version 2.2.3)

qqplot: Methods for Function qqplot in Package `distr'

Description

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 ($H_0$-)distribution. Graphical parameters may be given as arguments to qqplot. The stats function is just the method for signature x=ANY,y=ANY.

Usage

qqplot(x, y, ...)
## S3 method for class '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

Arguments

x
object of class "ANY" (stats-method) or of code "UnivariateDistribution"; to be compared to y.
y
object of class "ANY" (stats-method) or of class "UnivariateDistribution".
n
numeric; number of quantiles at which to do the comparison.
withIdLine
logical; shall line y = x be plotted in?
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 qqplot)?
xlab
x-label
ylab
y-label
...
further parameters for function plot
width
width (in inches) of the graphics device opened
height
height (in inches) of the graphics device opened
withSweave
logical: if TRUE (for working with Sweave) no extra device is opened and height/width are not set
mfColRow
shall default partition in panels be used --- defaults to TRUE
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 x-quantiles lie in support(y)?
col.NotInSupport
logical; if preceding check TRUE color of x-quantiles if not in support(y)
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

Value

  • As for function qqplot from package stats: a list with components
  • xThe x coordinates of the points that were/would be plotted
  • yThe corresponding quantiles of the second distribution, including NAs.

Details

[object Object],[object Object]

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

See Also

qqplot from package stats -- the standard QQ plot function and qqbounds, used by qqplot to produce confidence intervals.

Examples

Run this code
qqplot(Norm(15,sqrt(30)), Chisq(df=15))
## some discrete Distributions:
P <- Pois(5)
B <- Binom(size=2000,prob=5/2000)
qqplot(B,P)
qqplot(B,P, nosym.pCI=TRUE)
## some Lebesgue-Decomposed 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)
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)

Run the code above in your browser using DataCamp Workspace