qqnorm
function is generic (see Methods);
method functions can be written to handle specific classes of data.
Classes that already have methods for this function include:
aov
,
aovlist
,
maov
.
qqnorm(x, ...) qqnorm.default(x, datax = F, plot.it = T, xlab=<<see below>>, ylab=<<see below>>, weights=NULL, freq=NULL, ...) qqplot(x, y, plot.it = T)
bdNumeric
vector for
qqplot
and
qqnorm.default
, an object for
qqnorm
.
Missing values (NA) are allowed.
bdNumeric
vector (not necessarily of the same length as
x
).
Missing values (NA) are allowed.
TRUE
, data goes on the x-axis; if
FALSE
data goes on the y-axis.
FALSE
,
qqplot.default
and
qqnorm
return
a list with components
x
and
y
, giving the
coordinates of the points that would have been plotted.
datax
is
TRUE
,
is the deparsed argument passed as
x
for the x-axis,
and
"Quantiles of Standard Normal"
for the y-axis. These are
switched if
datax
is
FALSE
.
qqnorm.default
, a numeric vector the same length as
x
used to
weight the probabilities associated with
x
.
qqnorm.default
, a numeric vector the same length as
x
used to
replicate the values of
x
.
type
and
log
to control plot type and logarithmic axes (see
).
Use the arguments
xlim
and
ylim
to control the limits of the plot
region.
In addition, the high-level graphics arguments described under
and the arguments to
may be supplied to this function.
plot.it
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.
plot.it=TRUE
, a quantile-quantile plot is produced on the current graphics
device.
In
qqplot
, each vector or
bdVector
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 and an
optional vector of
weights
for a normal (Gaussian) probability plot.
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.
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.
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(length(lottery.payoff))) # evaluate several times to train your eye set.seed(493) my.sample <- rt(100, 5) lab <- "100 observations from a t-distribution with 5 df" qqnorm(my.sample, main = lab, sub = "QQ Plot with Line") qqline(my.sample)