Last chance! 50% off unlimited learning
Sale ends in
plotPredIntNparSimultaneousTestPowerCurve(n = 8, n.median = 1, k = 1, m = 2,
r = 1, rule = "k.of.m", lpl.rank = ifelse(pi.type == "upper", 0, 1),
n.plus.one.minus.upl.rank = ifelse(pi.type == "lower", 0, 1), pi.type = "upper",
r.shifted = r, integrate.args.list = NULL, method = "approx", NMC = 100,
range.delta.over.sigma = c(0, 5), plot.it = TRUE, add = FALSE, n.points = 20,
plot.col = "black", plot.lwd = 3 * par("cex"), plot.lty = 1,
digits = .Options$digits, cex.main = par("cex"), ..., main = NULL,
xlab = NULL, ylab = NULL, type = "l")
n.median=1
(i.e., individual
observations). Note that all future medians must be based on the same
sample size.rule="k.of.m"
), a positive integer
specifying the minimum number of observations (or medians) out of $m$
observations (or medians) (all obtained on one future sampling m=2
, except when rule="Modified.CA"
, in which
case this argumer=1
."k.of.m"
($k$-of-$m$ rule; the default), "CA"
(California rule),
and "Modified.CA"
(modified California rule).pi.type="lower"
, the
default value is lpl.rank=1
(implying the minimum value of x
in.plus.one.minus.upl.rank=1
means use the first largest value, and in general a value of
"two.sided"
(the default), "lower"
, and
"upper"
.1
and r
specifying the number of future sampling
occasions for which the scaled mean is shifted by $\Delta/\sigma$.
The default value is r.shifted=r
.integrate
function. The default
value is NULL
."approx"
(the default) and "simulate"
(use
Monte Carlo simulation).method="simulate"
. The default value is NMC=100
.range.delta.over.sigma=c(0,5)
.add
below) on the current graphics device.
If plot.it=FALSE
, no plot is produced, but a list of (x,y) valuadd=TRUE
),
or to create a plot from scratch (add=FALSE
). The default value is add=FALSE
.
This argument is ignored if pl
n.points
x-values evenly spaced between range.x.var[1]
and
range.x.var[2]
. The default value is n.points=100
.plot.col="black"
. See the entry for col
in the help file for par
3*par("cex")
. See the entry for lwd
in the help file for par
for more information.plot.lty=1
. See the entry for lty
in the help file for par
for more information.options("digits")
.par
).plotPredIntNparSimultaneousTestPowerCurve
invisibly returns a list with
components:predIntNparSimultaneousTestPower
for
information on how to compute the power of a hypothesis test for the difference
between two means of normal distributions based on a nonparametric simultaneous
prediction interval.predIntNparSimultaneous
.
Gansecki, M. (2009). Using the Optimal Rank Values Calculator.
US Environmental Protection Agency, Region 8, March 10, 2009.predIntNparSimultaneousTestPower
,
predIntNparSimultaneous
,
predIntNparSimultaneousN
,
predIntNparSimultaneousConfLevel
,
plotPredIntNparSimultaneousDesign
,
predIntNpar
, tolIntNpar
.# Example 19-5 of USEPA (2009, p. 19-33) shows how to compute nonparametric upper
# simultaneous prediction limits for various rules based on trace mercury data (ppb)
# collected in the past year from a site with four background wells and 10 compliance
# wells (data for two of the compliance wells are shown in the guidance document).
# The facility must monitor the 10 compliance wells for five constituents
# (including mercury) annually.
# We will pool data from 4 background wells that were sampled on
# a number of different occasions, giving us a sample size of
# n = 20 to use to construct the prediction limit.
# There are 10 compliance wells and we will monitor 5 different
# constituents at each well annually. For this example, USEPA (2009)
# recommends setting r to the product of the number of compliance wells and
# the number of evaluations per year (i.e., r = 10 * 1 = 10).
# Here we will reproduce Figure 19-2 on page 19-35. This figure plots the
# power of the nonparametric simultaneous prediction interval for 6 different
# plans:
# Rule Median.n k m Order.Statistic Achieved.alpha BG.Limit
#1) k.of.m 1 1 3 Max 0.0055 0.28
#2) k.of.m 1 1 4 Max 0.0009 0.28
#3) Modified.CA 1 1 4 Max 0.0140 0.28
#4) k.of.m 3 1 2 Max 0.0060 0.28
#5) k.of.m 1 1 4 2nd 0.0046 0.25
#6) k.of.m 1 1 4 3rd 0.0135 0.24
# Here is the power curve for the 1-of-4 sampling strategy.
dev.new()
plotPredIntNparSimultaneousTestPowerCurve(n = 20, k = 1, m = 4, r = 10,
rule = "k.of.m", n.plus.one.minus.upl.rank = 3, pi.type = "upper",
r.shifted = 1, method = "approx", range.delta.over.sigma = c(0, 5), main = "")
title(main = paste(
"Power Curve for Nonparametric 1-of-4 Sampling Strategy Based on",
"25 Background Samples, SWFPR=10%, and 2 Future Sampling Periods",
sep = ""), cex.main = 1.1)
#----------
# Here are the power curves for all 6 sampling strategies.
# Because these take several seconds to create, here we have commented out
# the R commands. To run this example, just remove the pound signs (#) from
# in front of the R commands.
#dev.new()
#plotPredIntNparSimultaneousTestPowerCurve(n = 20, k = 1, m = 4, r = 10,
# rule = "k.of.m", n.plus.one.minus.upl.rank = 3, pi.type = "upper",
# r.shifted = 1, method = "approx", range.delta.over.sigma = c(0, 5), main = "")
#plotPredIntNparSimultaneousTestPowerCurve(n = 20, n.median = 3, k = 1, m = 2,
# r = 10, rule = "k.of.m", n.plus.one.minus.upl.rank = 1, pi.type = "upper",
# r.shifted = 1, method = "approx", range.delta.over.sigma = c(0, 5),
# add = TRUE, plot.col = 2, plot.lty = 2)
#plotPredIntNparSimultaneousTestPowerCurve(n = 20, r = 10, rule = "Modified.CA",
# n.plus.one.minus.upl.rank = 1, pi.type = "upper", r.shifted = 1,
# method = "approx", range.delta.over.sigma = c(0, 5), add = TRUE,
# plot.col = 3, plot.lty = 3)
#plotPredIntNparSimultaneousTestPowerCurve(n = 20, k = 1, m = 4, r = 10,
# rule = "k.of.m", n.plus.one.minus.upl.rank = 2, pi.type = "upper",
# r.shifted = 1, method = "approx", range.delta.over.sigma = c(0, 5),
# add = TRUE, plot.col = 4, plot.lty = 4)
#plotPredIntNparSimultaneousTestPowerCurve(n = 20, k = 1, m = 3, r = 10,
# rule = "k.of.m", n.plus.one.minus.upl.rank = 1, pi.type = "upper",
# r.shifted = 1, method = "approx", range.delta.over.sigma = c(0, 5),
# add = TRUE, plot.col = 5, plot.lty = 5)
#plotPredIntNparSimultaneousTestPowerCurve(n = 20, k = 1, m = 4, r = 10,
# rule = "k.of.m", n.plus.one.minus.upl.rank = 1, pi.type = "upper",
# r.shifted = 1, method = "approx", range.delta.over.sigma = c(0, 5),
# add = TRUE, plot.col = 6, plot.lty = 6)
#legend("topleft", legend = c("1-of-4, 3rd", "1-of-2, Max, Median", "Mod CA",
# "1-of-4, 2nd", "1-of-3, Max", "1-of-4, Max"), lwd = 3 * par("cex"),
# col = 1:6, lty = 1:6, bty = "n")
#title(main = "Figure 19-2. Comparison of Full Power Curves")
#==========
# Clean up
#---------
graphics.off()
Run the code above in your browser using DataLab