Learn R Programming

gap (version 1.5-1)

qqunif: Q-Q plot for uniformly distributed random variable

Description

This function produces Q-Q plot for a random variable following uniform distribution with or without using log-scale. Note that the log-scale is by default for type "exp", which is a plot based on exponential order statistics. This appears to be more appropriate than the commonly used procedure whereby the expected value of uniform order statistics is directly log-transformed.

Usage

qqunif(
  u,
  type = "unif",
  logscale = TRUE,
  base = 10,
  col = palette()[4],
  lcol = palette()[2],
  ci = FALSE,
  alpha = 0.05,
  ...
)

Value

The returned value is a list with components of a qqplot:

x

expected value for uniform order statistics or its -log(,base) counterpart

y

observed value or its -log(,base) counterpart

Arguments

u

a vector of uniformly distributed random variables.

type

string option to specify distribution: "unif"=uniform, "exp"=exponential.

logscale

to use logscale.

base

the base of the log function.

col

color for points.

lcol

color for the diagonal line.

ci

logical option to show confidence interval.

alpha

1-confidence level, e.g., 0.05.

...

other options as appropriae for the qqplot function.

Author

Jing Hua Zhao

References

Balakrishnan N, Nevzorov VB. A Primer on Statistical Distributions. Wiley 2003.

Casella G, Berger RL. Statistical Inference, Second Edition. Duxbury 2002.

Davison AC. Statistical Models. Cambridge University Press 2003.

See Also

qqfun