QQplot: Creates a qqplot with shaded density estimate

View source: R/QQplot.R

QQplotR Documentation

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

qqplot, qqnorm

Examples


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


UsingR documentation built on March 18, 2022, 7:32 p.m.