plotPredIntNormTestPowerCurve {EnvStats}  R Documentation 
Plot power vs. \Delta/\sigma
(scaled minimal detectable difference) for a
sampling design for a test based on a prediction interval for a normal distribution.
plotPredIntNormTestPowerCurve(n = 8, df = n  1, n.mean = 1, k = 1,
range.delta.over.sigma = c(0, 5), pi.type = "upper", conf.level = 0.95,
plot.it = TRUE, add = FALSE, n.points = 20, plot.col = "black",
plot.lwd = 3 * par("cex"), plot.lty = 1, digits = .Options$digits, ...,
main = NULL, xlab = NULL, ylab = NULL, type = "l")
n 
positive integer greater than 2 indicating the sample size upon which
the prediction interval is based. The default is value is 
df 
positive integer indicating the degrees of freedom associated with
the sample size. The default value is 
n.mean 
positive integer specifying the sample size associated with the future average(s).
The default value is 
k 
positive integer specifying the number of future observations that the
prediction interval should contain with confidence level 
range.delta.over.sigma 
numeric vector of length 2 indicating the range of the xvariable to use for the
plot. The default value is 
pi.type 
character string indicating what kind of prediction interval to compute.
The possible values are 
conf.level 
numeric scalar between 0 and 1 indicating the confidence level of the
prediction interval. The default value is 
plot.it 
a logical scalar indicating whether to create a plot or add to the existing plot
(see explanation of the argument 
add 
a logical scalar indicating whether to add the design plot to the existing plot ( 
n.points 
a numeric scalar specifying how many (x,y) pairs to use to produce the plot.
There are 
plot.col 
a numeric scalar or character string determining the color of the plotted line or points. The default value
is 
plot.lwd 
a numeric scalar determining the width of the plotted line. The default value is

plot.lty 
a numeric scalar determining the line type of the plotted line. The default value is

digits 
a scalar indicating how many significant digits to print out on the plot. The default
value is the current setting of 
main , xlab , ylab , type , ... 
additional graphical parameters (see 
See the help file for predIntNormTestPower
for information on how to
compute the power of a hypothesis test for the difference between two means of
normal distributions based on a prediction interval for a normal distribution.
plotPredIntNormTestPowerCurve
invisibly returns a list with components:
x.var 
xcoordinates of points that have been or would have been plotted. 
y.var 
ycoordinates of points that have been or would have been plotted. 
See the help files for predIntNorm
and
predIntNormSimultaneous
.
In the course of designing a sampling program, an environmental scientist may wish
to determine the relationship between sample size, significance level, power, and
scaled difference if one of the objectives of the sampling program is to determine
whether two distributions differ from each other. The functions
predIntNormTestPower
and plotPredIntNormTestPowerCurve
can be
used to investigate these relationships for the case of normallydistributed
observations. In the case of a simple shift between the two means, the test based
on a prediction interval is not as powerful as the twosample ttest. However, the
test based on a prediction interval is more efficient at detecting a shift in the
tail.
Steven P. Millard (EnvStats@ProbStatInfo.com)
See the help files for predIntNorm
and
predIntNormSimultaneous
.
predIntNorm
, predIntNormK
,
predIntNormTestPower
, predIntNormSimultaneous
,
predIntNormSimultaneousK
,
predIntNormSimultaneousTestPower
, Prediction Intervals,
Normal.
# Pages 616 to 617 of USEPA (2009) present EPA Reference Power Curves (ERPC)
# for groundwater monitoring:
#
# "Since effect sizes discussed in the next section often cannot or have not been
# quantified, the Unified Guidance recommends using the ERPC as a suitable basis
# of comparison for proposed testing procedures. Each reference power curve
# corresponds to one of three typical yearly statistical evaluation schedules 
# quarterly, semiannual, or annual  and represents the cumulative power
# achievable during a single year at one wellconstituent pair by a 99% upper
# (normal) prediction limit based on n = 10 background measurements and one new
# measurement from the compliance well.
#
# Here we will reproduce Figure 63 on page 617.
dev.new()
plotPredIntNormTestPowerCurve(n = 10, k = 1, conf.level = 0.99,
ylim = c(0, 1), main="")
plotPredIntNormTestPowerCurve(n = 10, k = 2, conf.level = 0.99,
add = TRUE, plot.col = "red", plot.lty = 2)
plotPredIntNormTestPowerCurve(n = 10, k = 4, conf.level = 0.99,
add = TRUE, plot.col = "blue", plot.lty = 3)
legend("topleft", c("Quarterly", "SemiAnnual", "Annual"), lty = 3:1,
lwd = 3 * par("cex"), col = c("blue", "red", "black"), bty = "n")
title(main = paste("Power vs. Delta/Sigma for Upper Prediction Interval with",
"n=10, Confidence=99%, and Various Sampling Frequencies", sep="\n"))
#==========
## Not run:
# Plot power vs. scaled minimal detectable difference for various sample sizes
# using a 5
dev.new()
plotPredIntNormTestPowerCurve(n = 8, k = 1, ylim = c(0, 1), main="")
plotPredIntNormTestPowerCurve(n = 16, k = 1, add = TRUE, plot.col = "red")
plotPredIntNormTestPowerCurve(n = 32, k = 1, add = TRUE, plot.col = "blue")
legend("bottomright", c("n=32", "n=16", "n=8"), lty = 1, lwd = 3 * par("cex"),
col = c("blue", "red", "black"), bty = "n")
title(main = paste("Power vs. Delta/Sigma for Upper Prediction Interval with",
"k=1, Confidence=95%, and Various Sample Sizes", sep="\n"))
#==========
# Clean up
#
graphics.off()
## End(Not run)