Learn R Programming

qualityTools (version 1.31.1)

qqPlot: Quantile-Quantile Plots for various distributions

Description

qqPlot creates a QQ plot of the values in x including a line which passes through the first and third quartiles. Supported distributions are beta", "cauchy", "chi-squared", "exponential", "f", "gamma", "geometric", "log-normal", "lognormal", "logistic", "negative binomial", "normal", "Poisson", "t" and "weibull"

Usage

qqPlot(x, y, main, xlab, ylab, start, ...)

Arguments

x
the sample for qqPlot
y
a character specifying the distribution for the QQ plot or the second sample (if given --> defaulting to qqplot)
main
graphical parameter
xlab
graphical parameter
ylab
graphical parameter
start
A named list giving the parameters to be fitted with initial values. Must be supplied for some distribution. (see Details)
...
further graphical parameters (see par)

Value

  • a list containing the x and y quantiles
  • xsample quantiles
  • ytheoretical quantiles

Details

Distribution fitting is deligated to function fitdistr of the R-package MASS

See Also

fitdistr in R-package MASS

Examples

Run this code
#set up the plotting window for 6 plots
par(mfrow = c(3,2))

#generate random data from weibull distribution
x = rweibull(20, 8, 2)

#Quantile-Quantile Plot for different distributions
qqPlot(x, "log-normal")
qqPlot(x, "normal")
qqPlot(x, "exponential", DB = TRUE)
qqPlot(x, "cauchy")
qqPlot(x, "weibull")
qqPlot(x, "logistic")

Run the code above in your browser using DataLab