ts_bands {hwep} | R Documentation |
Get simultaneous confidence bands for a uniform QQ-plot
Description
This will provide 100(1-a)% simultaneous confidence bands for a
sample of size n
. It does this by the "tail-sensitive" approach
of Aldor-Noiman et al (2013), which uses simulated uniform vectors. The
number of simulations is controlled by nsamp
.
Usage
ts_bands(n, nsamp = 1000, a = 0.05)
Arguments
n |
Sample size. |
nsamp |
Number of simulation repetitions. |
a |
The significance level. |
Details
The procedure used is described in Aldor-Noiman et al (2013). But note that they have a mistake in their paper. Step (e) of their algorithm on page 254 should be the CDF of the Beta distribution, not the quantile function.
Value
A list of length 3. The $lower
and $upper
confidence
limits at uniform quantiles $q
.
Author(s)
David Gerard
References
Aldor-Noiman, S., Brown, L. D., Buja, A., Rolke, W., & Stine, R. A. (2013). The power to see: A new graphical test of normality. The American Statistician, 67(4), 249-260.
Examples
ts <- ts_bands(100)
graphics::plot(x = ts$q,
y = ts$upper,
type = "l",
xlim = c(0, 1),
ylim = c(0, 1),
xlab = "Theoretical Quantiles",
ylab = "Empirical Quantiles")
graphics::lines(x = ts$q, y = ts$lower)
graphics::lines(x = ts$q, y = ts$q, lty = 2)