Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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.

Value

Produces a graphic

Author(s)

John Verzani

See Also

Examples

x = rnorm(100)
y = rt(100, df=3)
QQplot(x,y)

UsingR

Data Sets, Etc. for the Text "Using R for Introductory Statistics", Second Edition

v2.0-6
GPL (>= 2)
Authors
John Verzani <verzani@math.csi.cuny.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.