lattice (version 0.10-10)

qqmath: Q-Q Plot with Theoretical Distribution

Description

Quantile-Quantile plot of a sample and a theoretical distribution

Usage

qqmath(formula, distribution = qnorm, f.value = NULL, ...)

Arguments

formula
formula of the form ~ x | g1 * g2 * ..., where x must be a numeric.
distribution
a quantile function that takes a vector of probabilities as argument and produces the corresponding quantiles. Possible values are qnorm,qunif etc. Distributions with other required arguments need to be passed in as user defin
f.value
optional function of a single integer (representing sample size), returning a vector of probabilities corresponding to which quantiles should be plotted. The typical value for this argument is ppoints, which is also the S-PLUS def
...
Other arguments

Value

  • An object of class ``trellis''. The `update' method can be used to update components of the object and the `print' method (usually called by default) will plot it on an appropriate plotting device.

synopsis

qqmath(formula, data = parent.frame(), allow.multiple = FALSE, outer = TRUE, auto.key = FALSE, aspect = "fill", panel = "panel.qqmath", prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, f.value = NULL, distribution = qnorm, drop.unused.levels, ..., default.scales, subscripts = !is.null(groups), subset = TRUE)

Details

qqmath produces a Q-Q plot of the given sample and a theoretical distribution. The default behaviour of qqmath is different from the corresponding S-PLUS function, but is similar to qqnorm. See the entry for f.value for specifics.

This and all other high level Trellis functions have several arguments in common. These are extensively documented only in the help page for xyplot, which should be consulted to learn more detailed usage.

See Also

xyplot, panel.qqmath, panel.qqmathline, prepanel.qqmathline, Lattice, quantile

Examples

Run this code
qqmath(~ rnorm(100), distribution = function(p) qt(p, df = 10))
qqmath(~ height | voice.part, aspect = 1, data = singer,
       prepanel = prepanel.qqmathline,
       panel = function(x, y) {
          panel.qqmathline(y, distribution = qnorm)
          panel.qqmath(x, y)
       })

Run the code above in your browser using DataCamp Workspace