% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qqunif.R
\name{qqunif}
\alias{qqunif}
\title{Q-Q plot for uniformly distributed random variables}
\usage{
qqunif(
  u,
  type = "unif",
  logscale = TRUE,
  base = 10,
  col = palette()[4],
  lcol = palette()[2],
  ci = FALSE,
  alpha = 0.05,
  ...
)
}
\arguments{
\item{u}{A vector of uniformly distributed random variables.}

\item{type}{Distribution type: \code{"unif"} for uniform order statistics or \code{"exp"} for exponential order statistics.}

\item{logscale}{Logical; use log scale.}

\item{base}{Base of the logarithm.}

\item{col}{Color for points.}

\item{lcol}{Color for the diagonal reference line.}

\item{ci}{Logical; show confidence intervals.}

\item{alpha}{Significance level for confidence intervals.}

\item{...}{Additional graphical arguments passed to \code{qqplot()}.}
}
\value{
Invisibly returns the list produced by \code{qqplot()} with components:
\describe{
\item{x}{Expected quantiles.}
\item{y}{Observed quantiles.}
}
}
\description{
Q-Q plot for uniformly distributed random variables
}
\details{
This function produces a Q-Q plot for a random variable following a uniform distribution, optionally on a logarithmic scale.

For \code{type = "exp"}, the plot is based on exponential order statistics, which is generally more appropriate than directly log-transforming the expected uniform order statistics.
}
\examples{
\dontrun{
u_obs <- runif(1000)
r <- qqunif(u_obs,pch=21,bg="blue",bty="n")
u_exp <- r$y
hits <- u_exp >= 2.30103
points(r$x[hits],u_exp[hits],pch=21,bg="green")
legend("topleft",sprintf("GC.lambda = \%.4f",gc.lambda(u_obs)))
}

}
\references{
\insertRef{balakrishnan03}{gap}
\insertRef{casella02}{gap}
\insertRef{davison03}{gap}
}
\seealso{
\code{\link{qqfun}}
}
\author{
Jing Hua Zhao
}
\keyword{distribution}
\keyword{hplot}
\keyword{univar}
