QRM (version 0.4-13)

QQplot: Generic Quantile-Quantile Plot

Description

Constructs a quantile-quantile plot against a given reference distribution.

Usage

QQplot(x, a = 0.5, reference = c("normal", "exp", "student"), ...)

Arguments

x

vector, data for QQ-plot.

a

numeric, the offset fraction to be used in ppoints(); typically in (0, 1).

reference

character, name of reference distribution.

ellipsis argument, passed down to quantile function of reference distribution.

Value

Produces QQ-plot and returns invisibly a list of (x, y) pairs.

Details

Special forms like ParetoQQ plots can also be created via this function. E.g., to create a ParetoQQ plot, merely pass log(data) in place of data as the first parameter and use reference = "exp" as the reference distribution. The ParetoQQ plot should provide a linear graph when a log transform of the data is plotted against the exponential distribution.

See Also

ppoints

Examples

Run this code
# NOT RUN {
QQplot(rnorm(1000), reference = "normal") 
QQplot(rexp(1000), reference = "exp", rate = 0.3) 
# }

Run the code above in your browser using DataCamp Workspace