1\name{qqPlot}
2\Rdversion{1.1}
3\alias{qqPlot}
4\keyword{Distribution Identification}
5\keyword{Six Sigma}
6\title{
7Quantile-Quantile Plots for various distributions
8}
9\description{
10\code{qqPlot} creates a QQ plot of the values in x including a line which passes through the first and third quartiles.
11}
12\usage{
13qqPlot(x, y, confbounds = TRUE, alpha, main, xlab, ylab, xlim, ylim,
14       border = "red", bounds.col = "black", bounds.lty = 1, start, ...)
15}
16\arguments{
17  \item{x}{
18the sample for qqPlot
19}
20  \item{y}{
21character string specifying the distribution of x. The function \code{qqPlot} will support the following character strings for \code{y}:
22  \itemize{
23   \item \dQuote{beta}
24   \item \dQuote{cauchy}
25   \item \dQuote{chi-squared}
26   \item \dQuote{exponential}
27   \item \dQuote{f}
28   \item \dQuote{gamma}
29   \item \dQuote{geometric}
30   \item \dQuote{log-normal}
31   \item \dQuote{lognormal}
32   \item \dQuote{logistic}
33   \item \dQuote{negative binomial}
34   \item \dQuote{normal}
35   \item \dQuote{Poisson}
36   \item \dQuote{t}
37   \item \dQuote{weibull}
38}
39By default \code{distribution} is set to \dQuote{normal}.
40}
41  \item{confbounds}{
42boolean value: \sQuote{TRUE} if confidence bounds should be drawn (default value).
43}
44  \item{alpha}{
45significance level for the confidence bounds, set on \sQuote{0.05} by default.
46}
47  \item{main}{
48an overall title for the plot: see \code{\link{title}}.
49}
50  \item{xlab}{
51a title for the x axis: \code{\link{title}}.
52}
53  \item{ylab}{
54a title for the y axis: \code{\link{title}}.
55}
56  \item{xlim}{
57vector giving the range of the x-axis.
58}
59  \item{ylim}{
60vector giving the range of the y-axis.
61}
62\item{border}{
63numerical value or single character string giving the color of interpolation line.\cr
64By default \code{border} is set to \dQuote{red}.
65}
66\item{bounds.col}{
67numerical value or single character string giving the color of confidence bounds lines.\cr
68By default bounds is set to \dQuote{black}.
69}
70\item{bounds.lty}{
71numerical value  giving the color of confidence bounds lines.\cr
72By default bounds is set to \sQuote{1}.
73}
74\item{start}{
75A named list giving the parameters to be fitted with initial values. Must be supplied for some distribution: (see Details).
76}
77  \item{\dots}{
78further graphical parameters: (see \code{\link{par}}).
79}
80}
81\details{
82Distribution fitting is deligated to function \code{\link{fitdistr}} of the R-package MASS.\cr
83For computation of the confidence bounds the variance of the quantiles is estimated using the delta method,\cr
84which implies estimation of observed Fisher Information matrix as well as the gradient of the CDF of the fitted distribution.\cr
85Where possible, those values are replaced by their normal approximation.
86}
87\value{
88a list containing the x and y quantiles
89\item{x}{sample quantiles}
90\item{y}{theoretical quantiles}
91}
92\author{
93Thomas Roth \email{thomas.roth@tu-berlin.de}
94}
95\note{
96 For an example in context which shows the usage of the function \code{qqPlot()}
97 please read the vignette for the package \code{\link{qualityTools}} at \url{http://www.r-qualitytools.org/html/Analyze.html}.
98}
99\seealso{
100\code{\link{ppPlot}}
101\code{\link{fitdistr}} in R-package MASS\cr
102\url{http://www.r-qualitytools.org/html/Analyze.html}
103}
104\examples{
105#set up the plotting window for 6 plots
106par(mfrow = c(3,2))
107
108#generate random data from weibull distribution
109x = rweibull(20, 8, 2)
110
111#Quantile-Quantile Plot for different distributions
112qqPlot(x, "log-normal")
113qqPlot(x, "normal")
114qqPlot(x, "exponential", DB = TRUE)
115qqPlot(x, "cauchy")
116qqPlot(x, "weibull")
117qqPlot(x, "logistic")
118}
119