Distribution of the Range of Standard Normals

DESCRIPTION:
Density, cumulative probability, quantiles and random generation of the distribution of the range of size independent standard Normal deviates.

USAGE:
dnrange(x, size, nevals=200)
pnrange(q, size, nevals=200)
qnrange(p, size, nevals=200)
rnrange(n, size)

REQUIRED ARGUMENTS:
x:
numeric vector of values for which the density is desired. This will be replicated to be the length of size if size is longer.
q:
numeric vector of values for which the cumulative probability is desired. This will be replicated to be the length of size if size is longer.
p:
vector of probabilities for which quantiles are desired. This will be replicated to be the length of size if size is longer. Missing values are not accepted.
n:
the number of random numbers desired, or if the length of n is greater than 1, then the length(n) random numbers are returned.
size:
vector giving the size of the sample of Normal deviates. This is replicated to be the length of p, q or x, or the number of replicates generated, if it is shorter than this. Missing values are not accepted in rnrange and qnrange.

OPTIONAL ARGUMENTS:
nevals:
the number of points at which to perform numerical integration. More points will give better accuracy but will be slower.

VALUE:
a numeric vector giving the density, cumulative probability, quantiles, or random deviates for the distribution.

SIDE EFFECTS:
the function rnrange causes creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:
This distribution is primarily used for R-charts in quality control work.

REFERENCES:
Hartley, H. O. (1942). The range in random samples. Biometrika 32 334-348.

SEE ALSO:
qcc , Normal .

EXAMPLES:
qnrange(c(.0005,.9995), 16) # 99.9% limits for an R-chart