ppoints(n, a=0.5, weights=NULL)
length(n)==1
),
or a vector whose length is the number of points desired.
This is ignored if weights are
present (
n
is set to
length(weights)
).
0<=a<=1
.
The default is
.5
.
(1:n - a)/(n+1-2*a)
.
For
a=.5
this is equivalent to returning the midpoints of
the
n
equal subintervals of (0,1). Larger values of
a
move the points further away from each other (but still
staying in the equal subintervals) and smaller values move them
closer together.
If weights are present the interval
(0,1)
is divided into
length(weights)
subintervals such that the width of
subinterval
i
is proportional to
weights[i]
.
The parameter
a
controls the spacing of returned values
from each subinterval as in the unweighted case.
The result is a vector of probabilities suitable for use in
probability (QQ) plots.
Plotting
sort(y)
against
qdist(p)
(where
p
is this result)
gives a probability (QQ) plot of
y
against the distribution for which
qdist
is the
quantile function. The plot should be roughly linear if
y
is generated from the distribution
with quantile function
qdist
.
Blom, G. (1958). Statistical Estimates and Transformed Beta Variables. Wiley, New York.
y <- rlnorm(80) plot(qlnorm(ppoints(y)), sort(y)) # log normal qqplot plot(qlnorm(ppoints(length(y))), sort(y)) # the same thing plot(qgamma(ppoints(rain.nyc2), 4), sort(rain.nyc2))