Quantile-Quantile Plots - Generic Function

DESCRIPTION:

Produces a graphical display to test the distribution of data.

The qqnorm function is generic (see Methods); method functions can be written to handle specific classes of data. Classes which already have methods for this function include:

aov, aovlist, maov.

USAGE:

qqnorm(x, ...) 
qqnorm.default(x, datax = F, plot = T) 
qqplot(x, y, plot = T) 

REQUIRED ARGUMENTS:

x
a numeric vector for qqplot and qqnorm.default, an object for qqnorm. Missing values (NA) are allowed.
y
numeric vector (not necessarily of the same length as x). Missing values (NA) are allowed.

OPTIONAL ARGUMENTS:

datax
if TRUE, data goes on the x-axis; if FALSE data goes on the y-axis.
plot
if FALSE, qqplot.default and qqnorm return a list with components x and y, giving the coordinates of the points that would have been plotted.

Graphical parameters may also be supplied as arguments to this function (see par ). In particular these functions can take arguments type and log to control plot type and logarithmic axes (see plot.default). Use the arguments xlim and ylim to control the limits of the plot region. In addition, the high-level graphics arguments described under plot.default and the arguments to title may be supplied to this function.

VALUE:

if plot is FALSE, qqplot returns a list with components x and y, giving coordinates of the points that would have been plotted. qqnorm.default always returns such a list.

SIDE EFFECTS:

if plot=TRUE, a quantile-quantile plot is produced on the current graphics device.

DETAILS:

In qqplot each vector is taken as a sample, for the x- and y-axis values of an empirical probability plot.

The function qqnorm takes a single vector of data for a normal (Gaussian) probability plot.

BACKGROUND:

QQplots are used to assess whether data have a particular distribution, or whether two datasets have the same distribution. If the distributions are the same, then the plot will be approximately a straight line. The extreme points have more variability than points toward the center. A plot with a "U" shape means that one distribution is skewed relative to the other. An "S" shape implies that one distribution has longer tails than the other. In the default configuration a plot from qqnorm that is bent down on the left and bent up on the right means that the data have longer tails than the Gaussian.

REFERENCES:

Chambers, J. M., Cleveland, W. S., Kleiner, B. and Tukey, P. A. (1983). Graphical Methods for Data Analysis. Wadsworth, Belmont, California.

Hoaglin, D. C., Mosteller, F. and Tukey, J. W., editors (1983). Understanding Robust and Exploratory Data Analysis. Wiley, New York.

SEE ALSO:

abline , Normal , par , plot , plot.default , ppoints (to create QQplots for other distributions), qq , qqline , rnorm , title .

EXAMPLES:

zz <- qqplot(lottery.payoff, lottery3.payoff, plot = F)   
plot(zz)      # plot it 
abline(lmsreg(zz$x, zz$y))  # fit robust line and draw it 
qqnorm(rnorm(samplesize))  # samplesize must be previously specified 
                           # evaluate several times to train your eye 
set.seed(493) 
my.sample <- rt(100, 5) 
lab <- "100 samples from a t-distribution with 5 df" 
qqnorm(my.sample, main = lab, sub = "QQ Plot with Line") 
qqline(my.sample)