QQ-plot between two data vectors with 95 percent confidence bands based on the Kolmogorov-Smirnov statistic (Doksum and Sievers, 1976).
qqplot(x, y, pch = 20, xlab = "x Quantiles", ylab = "y Quantiles", regress = TRUE,
make.plot = TRUE, ...)# S3 method for qqplot
plot(x, ...)
# S3 method for qqplot
summary(object, ...)
qqplot
: numeric vector of length 'm' giving one data set.
plot
method function: list object of class “qqplot” returned by qqplot
.
list object of class “qqplot” returned by qqplot
.
numeric vector of length 'n' giving the other data set.
Plot character.
Character string giving the label for the abscissa axis.
Character string giving the label for the ordinate axis.
logical, should a regression line be fit to the quantiles?
logical, should the plot be created (TRUE) or not (FALSE)?
Other optional arguments to the plot function. Not used by summary
method function.
An object of class “qqplot” is invisibly returned by each function (in the case of the method functions, the object entered is simply returned invisibly). This is a list object with components:
calling string
list object with components x and y giving the object names for the objects passed into x and y, resp.
If regress was TRUE, then this is the fitted regression object as returned by lm. Otherwise, this component is not included.
data frame with components: x and y giving the quantiles for x and y, resp., and lower and upper giving the lower and upper 95 percent confidence bands, resp.
Plots the sorted (missing-values removed) 'x' values against the sorted, and interpolated (via the approxfun function from package stats), 'y' values. Confidence bands are about the sorted and interpolated 'y' values using +/- K/sqrt(M), where
K = 1.36
and
M = m*n / (m+n).
The plot
method function does exactly the same thing as qqplot
except that it does not need to do any calculations.
The summary
method function merely displays the original call to the function unless a regression line was fit between the quantiles, in which case summary information is displayed for the regression (i.e., the summary
method function for lm
is run on the “lm” object).
Doksum, K.A. and G.L. Sievers, 1976. Plotting with confidence: graphical comparisons of two populations. Biometrika, 63 (3), 421--434.
# NOT RUN {
z <- rnorm(100)
y <- rexp(100)
qqplot( z, y)
qqplot( y, z)
data( ftcanmax)
qqplot( ftcanmax[,"Prec"], z)
obj <- qqplot( ftcanmax[,"Prec"], y, make.plot=FALSE)
plot(obj)
summary(obj)
# }
Run the code above in your browser using DataLab