Learn R Programming

distr6 (version 1.6.9)

qqplot: Quantile-Quantile Plots for distr6 Objects

Description

Quantile-quantile plots are used to compare a "theoretical" or empirical distribution to a reference distribution. They can also compare the quantiles of two reference distributions.

Usage

qqplot(x, y, npoints = 3000, idline = TRUE, plot = TRUE, ...)

Arguments

x

distr6 object or numeric vector.

y

distr6 object or numeric vector.

npoints

number of evaluation points.

idline

logical; if TRUE (default), the line \(y = x\) is plotted

plot

logical; if TRUE (default), figures are displayed in the plot window; otherwise a data.table::data.table of points and calculated values is returned.

...

graphical parameters.

Details

If x or y are given as numeric vectors then they are first passed to the Empirical distribution. The Empirical distribution is a discrete distribution so quantiles are equivalent to the the Type 1 method in quantile.

See Also

plot.Distribution for plotting a distr6 object.

Examples

Run this code
# NOT RUN {
qqplot(Normal$new(mean = 15, sd = sqrt(30)), ChiSquared$new(df = 15))
qqplot(rt(200, df = 5), rt(300, df = 5),
  main = "QQ-Plot", xlab = "t-200",
  ylab = "t-300"
)
qqplot(Normal$new(mean = 2), rnorm(100, mean = 3))
# }

Run the code above in your browser using DataLab