plotPredIntLnormAltTestPowerCurve {EnvStats}  R Documentation 
Plot power vs. \theta_1/\theta_2
(ratio of means) for a
sampling design for a test based on a prediction interval for a lognormal distribution.
plotPredIntLnormAltTestPowerCurve(n = 8, df = n  1, n.geomean = 1, k = 1,
cv = 1, range.ratio.of.means = c(1, 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.geomean 
positive integer specifying the sample size associated with the future geometric
mean(s). The default value is 
k 
positive integer specifying the number of future observations that the
prediction interval should contain with confidence level 
cv 
positive value specifying the coefficient of variation for both the population
that was sampled to construct the prediction interval and the population that
will be sampled to produce the future observations. The default value is

range.ratio.of.means 
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 predIntLnormAltTestPower
for information on how to
compute the power of a hypothesis test for the ratio of two means of lognormal
distributions based on a prediction interval for a lognormal distribution.
plotPredIntLnormAltTestPowerCurve
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 predIntNormTestPower
.
Steven P. Millard (EnvStats@ProbStatInfo.com)
See the help files for predIntNormTestPower
and
tTestLnormAltPower
.
predIntLnormAltTestPower
,
predIntLnormAlt
,
predIntNorm
,
predIntNormK
,
plotPredIntNormTestPowerCurve
,
predIntLnormAltSimultaneous
,
predIntLnormAltSimultaneousTestPower
,
Prediction Intervals, LognormalAlt.
# Plot power vs. ratio of means for k=1 future observation for
# various sample sizes using a 5% significance level and assuming cv=1.
dev.new()
plotPredIntLnormAltTestPowerCurve(n = 8, k = 1,
range.ratio.of.means=c(1, 10), ylim = c(0, 1), main = "")
plotPredIntLnormAltTestPowerCurve(n = 16, k = 1,
range.ratio.of.means = c(1, 10), add = TRUE, plot.col = "red")
plotPredIntLnormAltTestPowerCurve(n = 32, k = 1,
range.ratio.of.means=c(1, 10), add = TRUE, plot.col = "blue")
legend("topleft", 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. Ratio of Means for Upper Prediction Interval",
"with k=1, Confidence=95%, and Various Sample Sizes", sep="\n"))
mtext("Assuming a Lognormal Distribution with CV = 1", line = 0)
#==========
## Not run:
# 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
# (normal) prediction limit based on n = 10 background measurements and one new
# measurement from the compliance well.
#
# Here we will create a variation of Figure 63 on page 617 based on
# using a lognormal distribution and plotting power versus ratio of the
# means assuming cv=1.
dev.new()
plotPredIntLnormAltTestPowerCurve(n = 10, k = 1, cv = 1, conf.level = 0.99,
range.ratio.of.means = c(1, 10), ylim = c(0, 1), main="")
plotPredIntLnormAltTestPowerCurve(n = 10, k = 2, cv = 1, conf.level = 0.99,
range.ratio.of.means = c(1, 10), add = TRUE, plot.col = "red", plot.lty = 2)
plotPredIntLnormAltTestPowerCurve(n = 10, k = 4, cv = 1, conf.level = 0.99,
range.ratio.of.means = c(1, 10), 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. Ratio of Means for Upper Prediction Interval with",
"n=10, Confidence=99%, and Various Sampling Frequencies", sep="\n"))
mtext("Assuming a Lognormal Distribution with CV = 1", line = 0)
## End(Not run)
#==========
# Clean up
#
graphics.off()