Learn R Programming

UsingR (version 2.0-7)

QQplot: Creates a qqplot with shaded density estimate

Description

Creates a qqplot of two variables along with graphs of their densities, shaded so that the corresponding percentiles are clearly matched up.

Usage

QQplot(x, y, n = 20, xsf = 4, ysf = 4, main = "qqplot", xlab = deparse(substitute(x)),
        ylab = deparse(substitute(y)), pch = 16, pcol = "black", shade = "gray", ...)

Arguments

x

The x variable

y

The y variable

n

number of points to plot in qqplot.

xsf

scale factor to adjust size of x density graph

ysf

scale factor to adjust size of y density graph

main

title

xlab

label for x axis

ylab

label for y axis

pch

plot character for points in qqplot

pcol

color of plot character

shade

shading color

extra arguments passed to plot.window

Value

Produces a graphic

Details

Shows density estimates for the two samples in a qqplot. Meant to make this useful plot more transparent to first-time users of quantile-quantile plots.

This function has some limitations: the scale factor may need to be adjusted; the code to shade only shaded trapezoids, and does not completely follow the density.

See Also

qqplot, qqnorm

Examples

Run this code
# NOT RUN {
x = rnorm(100)
y = rt(100, df=3)
QQplot(x,y)

# }

Run the code above in your browser using DataLab