Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/predIntLnormSimultaneous.R
Estimate the mean and standard deviation on the logscale for a lognormal distribution, or estimate the mean and coefficient of variation for a lognormal distribution (alternative parameterization), and construct a simultaneous prediction interval for the next r sampling occasions, based on one of three possible rules: kofm, California, or Modified California.
1 2 3 4 5 6 7  predIntLnormSimultaneous(x, n.geomean = 1, k = 1, m = 2, r = 1, rule = "k.of.m",
delta.over.sigma = 0, pi.type = "upper", conf.level = 0.95,
K.tol = .Machine$double.eps^0.5)
predIntLnormAltSimultaneous(x, n.geomean = 1, k = 1, m = 2, r = 1, rule = "k.of.m",
delta.over.sigma = 0, pi.type = "upper", conf.level = 0.95,
K.tol = .Machine$double.eps^0.5, est.arg.list = NULL)

x 
For For If 
n.geomean 
positive integer specifying the sample size associated with future
geometric means. The default value is 
k 
for the kofm rule ( 
m 
positive integer specifying the maximum number of future observations (or
geometric means) on one future sampling “occasion”.
The default value is 
r 
positive integer specifying the number of future sampling “occasions”.
The default value is 
rule 
character string specifying which rule to use. The possible values are

delta.over.sigma 
numeric scalar indicating the ratio Δ/σ. The quantity
Δ (delta) denotes the difference between the mean of the population
(on the logscale) that was sampled to construct the prediction interval, and the
mean of the population (on the logscale) that will be sampled to produce the future
observations. The quantity σ (sigma) denotes the population standard
deviation (on the logscale) for both populations.
See the DETAILS section below for more information. The default value is

pi.type 
character string indicating what kind of prediction interval to compute.
The possible values are 
conf.level 
a scalar between 0 and 1 indicating the confidence level of the prediction interval.
The default value is 
K.tol 
numeric scalar indicating the tolerance to use in the nonlinear search algorithm to
compute K. The default value is 
est.arg.list 
a list containing arguments to pass to the function

The function predIntLnormSimultaneous
returns a simultaneous prediction
interval as well as estimates of the meanlog and sdlog parameters.
The function predIntLnormAltSimultaneous
returns a prediction interval as
well as estimates of the mean and coefficient of variation.
A simultaneous prediction interval for a lognormal distribution is constructed by
taking the natural logarithm of the observations and constructing a prediction
interval based on the normal (Gaussian) distribution by calling
predIntNormSimultaneous
.
These prediction limits are then exponentiated to produce a prediction interval on
the original scale of the data.
If x
is a numeric vector, predIntLnormSimultaneous
returns a list of
class "estimate"
containing the estimated parameters, the prediction interval,
and other information. See the help file for
estimate.object
for details.
If x
is the result of calling an estimation function,
predIntLnormSimultaneous
returns a list whose class is the same as x
.
The list contains the same components as x
, as well as a component called
interval
containing the prediction interval information.
If x
already has a component called interval
, this component is
replaced with the prediction interval information.
Motivation
Prediction and tolerance intervals have long been applied to quality control and
life testing problems (Hahn, 1970b,c; Hahn and Nelson, 1973). In the context of
environmental statistics, prediction intervals are useful for analyzing data from
groundwater detection monitoring programs at hazardous and solid waste facilities.
One of the main statistical problems that plague groundwater monitoring programs at hazardous and solid waste facilities is the requirement of testing several wells and several constituents at each well on each sampling occasion. This is an obvious multiple comparisons problem, and the naive approach of using a standard ttest at a conventional αlevel (e.g., 0.05 or 0.01) for each test leads to a very high probability of at least one significant result on each sampling occasion, when in fact no contamination has occurred. This problem was pointed out years ago by Millard (1987) and others.
Davis and McNichols (1987) proposed simultaneous prediction intervals as a way of controlling the facilitywide false positive rate (FWFPR) while maintaining adequate power to detect contamination in the groundwater. Because of the ubiquitous presence of spatial variability, it is usually best to use simultaneous prediction intervals at each well (Davis, 1998a). That is, by constructing prediction intervals based on background (prelandfill) data on each well, and comparing future observations at a well to the prediction interval for that particular well. In each of these cases, the individual αlevel at each well is equal to the FWFRP divided by the product of the number of wells and constituents.
Often, observations at downgradient wells are not available prior to the construction and operation of the landfill. In this case, upgradient well data can be combined to create a background prediction interval, and observations at each downgradient well can be compared to this prediction interval. If spatial variability is present and a major source of variation, however, this method is not really valid (Davis, 1994; Davis, 1998a).
Chapter 19 of USEPA (2009) contains an extensive discussion of using the 1ofm rule and the Modified California rule.
Chapters 1 and 3 of Gibbons et al. (2009) discuss simultaneous prediction intervals
for the normal and lognormal distributions, respectively.
The kofm Rule
For the kofm rule, Davis and McNichols (1987) give tables with
“optimal” choices of k (in terms of best power for a given overall
confidence level) for selected values of m, r, and n. They found
that the optimal ratios of k to m (i.e., k/m) are generally small,
in the range of 1550%.
The California Rule
The California rule was mandated in that state for groundwater monitoring at waste
disposal facilities when resampling verification is part of the statistical program
(Barclay's Code of California Regulations, 1991). The California code mandates a
“California” rule with m ≥ 3. The motivation for this rule may have
been a desire to have a majority of the observations in bounds (Davis, 1998a). For
example, for a kofm rule with k=1 and m=3, a monitoring
location will pass if the first observation is out of bounds, the second resample
is out of bounds, but the last resample is in bounds, so that 2 out of 3 observations
are out of bounds. For the California rule with m=3, either the first
observation must be in bounds, or the next 2 observations must be in bounds in order
for the monitoring location to pass.
Davis (1998a) states that if the FWFPR is kept constant, then the California rule
offers little increased power compared to the kofm rule, and can
actually decrease the power of detecting contamination.
The Modified California Rule
The Modified California Rule was proposed as a compromise between a 1ofm
rule and the California rule. For a given FWFPR, the Modified California rule
achieves better power than the California rule, and still requires at least as many
observations in bounds as out of bounds, unlike a 1ofm rule.
Different Notations Between Different References
For the kofm rule described in this help file, both
Davis and McNichols (1987) and USEPA (2009, Chapter 19) use the variable
p instead of k to represent the minimum number
of future observations the interval should contain on each of the r sampling
occasions.
Gibbons et al. (2009, Chapter 1) presents extensive lists of the value of K for both kofm rules and California rules. Gibbons et al.'s notation reverses the meaning of k and r compared to the notation used in this help file. That is, in Gibbons et al.'s notation, k represents the number of future sampling occasions or monitoring wells, and r represents the minimum number of observations the interval should contain on each sampling occasion.
Steven P. Millard ([email protected])
Barclay's California Code of Regulations. (1991). Title 22, Section 66264.97 [concerning hazardous waste facilities] and Title 23, Section 2550.7(e)(8) [concerning solid waste facilities]. Barclay's Law Publishers, San Francisco, CA.
Davis, C.B. (1998a). GroundWater Statistics \& Regulations: Principles, Progress and Problems. Second Edition. Environmetrics \& Statistics Limited, Henderson, NV.
Davis, C.B. (1998b). Personal Communication, September 3, 1998.
Davis, C.B., and R.J. McNichols. (1987). Onesided Intervals for at Least p of m Observations from a Lognormal Population on Each of r Future Occasions. Technometrics 29, 359–370.
Fertig, K.W., and N.R. Mann. (1977). OneSided Prediction Intervals for at Least p Out of m Future Observations From a Lognormal Population. Technometrics 19, 167–177.
Gibbons, R.D., D.K. Bhaumik, and S. Aryal. (2009). Statistical Methods for Groundwater Monitoring, Second Edition. John Wiley & Sons, Hoboken.
Hahn, G.J. (1969). Factors for Calculating TwoSided Prediction Intervals for Samples from a Lognormal Distribution. Journal of the American Statistical Association 64(327), 878898.
Hahn, G.J. (1970a). Additional Factors for Calculating Prediction Intervals for Samples from a Lognormal Distribution. Journal of the American Statistical Association 65(332), 16681676.
Hahn, G.J. (1970b). Statistical Intervals for a Lognormal Population, Part I: Tables, Examples and Applications. Journal of Quality Technology 2(3), 115125.
Hahn, G.J. (1970c). Statistical Intervals for a Lognormal Population, Part II: Formulas, Assumptions, Some Derivations. Journal of Quality Technology 2(4), 195206.
Hahn, G.J., and W.Q. Meeker. (1991). Statistical Intervals: A Guide for Practitioners. John Wiley and Sons, New York.
Hahn, G., and W. Nelson. (1973). A Survey of Prediction Intervals and Their Applications. Journal of Quality Technology 5, 178188.
Hall, I.J., and R.R. Prairie. (1973). OneSided Prediction Intervals to Contain at Least m Out of k Future Observations. Technometrics 15, 897–914.
Millard, S.P. (1987). Environmental Monitoring, Statistics, and the Law: Room for Improvement (with Comment). The American Statistician 41(4), 249–259.
Millard, S.P., and Neerchal, N.K. (2001). Environmental Statistics with SPLUS. CRC Press, Boca Raton, Florida.
USEPA. (2009). Statistical Analysis of Groundwater Monitoring Data at RCRA Facilities, Unified Guidance. EPA 530/R09007, March 2009. Office of Resource Conservation and Recovery Program Implementation and Information Division. U.S. Environmental Protection Agency, Washington, D.C.
USEPA. (2010). Errata Sheet  March 2009 Unified Guidance. EPA 530/R09007a, August 9, 2010. Office of Resource Conservation and Recovery, Program Information and Implementation Division. U.S. Environmental Protection Agency, Washington, D.C.
predIntLnormAltSimultaneousTestPower
,
predIntNorm
, predIntNormSimultaneous
,
predIntNormSimultaneousTestPower
,
tolIntLnorm
, Lognormal, LognormalAlt,
estimate.object
, elnorm
, elnormAlt
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213  # Generate 8 observations from a lognormal distribution with parameters
# mean=10 and cv=1, then use predIntLnormAltSimultaneous to estimate the
# mean and coefficient of variation of the true distribution and construct an
# upper 95% prediction interval to contain at least 1 out of the next
# 3 observations.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(479)
dat < rlnormAlt(8, mean = 10, cv = 1)
predIntLnormAltSimultaneous(dat, k = 1, m = 3)
#Results of Distribution Parameter Estimation
#
#
#Assumed Distribution: Lognormal
#
#Estimated Parameter(s): mean = 11.2984322
# cv = 0.9524441
#
#Estimation Method: mvue
#
#Data: dat
#
#Sample Size: 8
#
#Prediction Interval Method: exact
#
#Prediction Interval Type: upper
#
#Confidence Level: 95%
#
#Minimum Number of
#Future Observations
#Interval Should Contain: 1
#
#Total Number of
#Future Observations: 3
#
#Prediction Interval: LPL = 0.00000
# UPL = 12.67555
#
# Compare the 95% 1of3 upper prediction limit to the California and
# Modified California upper prediction limits. Note that the upper
# prediction limit for the Modified California rule is between the limit
# for the 1of3 rule and the limit for the California rule.
predIntLnormAltSimultaneous(dat, k = 1, m = 3)$interval$limits["UPL"]
# UPL
#12.67555
predIntLnormAltSimultaneous(dat, m = 3, rule = "CA")$interval$limits["UPL"]
# UPL
#25.03606
predIntLnormAltSimultaneous(dat, rule = "Modified.CA")$interval$limits["UPL"]
# UPL
#17.10475
#
# Show how the upper 95% simultaneous prediction limit increases
# as the number of future sampling occasions r increases.
# Here, we'll use the 1of3 rule.
predIntLnormAltSimultaneous(dat, k = 1, m = 3)$interval$limits["UPL"]
# UPL
#12.67555
predIntLnormAltSimultaneous(dat, k = 1, m = 3, r = 10)$interval$limits["UPL"]
# UPL
#27.72615
#
# Compare the upper simultaneous prediction limit for the 1of3 rule
# based on individual observations versus based on geometric means of
# order 4.
predIntLnormAltSimultaneous(dat, k = 1, m = 3)$interval$limits["UPL"]
# UPL
#12.67555
predIntLnormAltSimultaneous(dat, n.geomean = 4, k = 1,
m = 3)$interval$limits["UPL"]
# UPL
#11.95532
#==========
# Example 191 of USEPA (2009, p. 1917) shows how to compute an
# upper simultaneous prediction limit for the 1of3 rule for
# r = 2 future sampling occasions. The data for this example are
# stored in EPA.09.Ex.19.1.sulfate.df.
# We will pool data from 4 background wells that were sampled on
# a number of different occasions, giving us a sample size of
# n = 25 to use to construct the prediction limit.
# There are 50 compliance wells and we will monitor 10 different
# constituents at each well at each of the r=2 future sampling
# occasions. To determine the confidence level we require for
# the simultaneous prediction interval, USEPA (2009) recommends
# setting the individual Type I Error level at each well to
# 1  (1  SWFPR)^(1 / (Number of Constituents * Number of Wells))
# which translates to setting the confidence limit to
# (1  SWFPR)^(1 / (Number of Constituents * Number of Wells))
# where SWFPR = sitewide false positive rate. For this example, we
# will set SWFPR = 0.1. Thus, the confidence level is given by:
nc < 10
nw < 50
SWFPR < 0.1
conf.level < (1  SWFPR)^(1 / (nc * nw))
conf.level
#[1] 0.9997893
#
# Look at the data:
names(EPA.09.Ex.19.1.sulfate.df)
#[1] "Well" "Month" "Day"
#[4] "Year" "Date" "Sulfate.mg.per.l"
#[7] "log.Sulfate.mg.per.l"
EPA.09.Ex.19.1.sulfate.df[,
c("Well", "Date", "Sulfate.mg.per.l", "log.Sulfate.mg.per.l")]
# Well Date Sulfate.mg.per.l log.Sulfate.mg.per.l
#1 GW01 19990708 63.0 4.143135
#2 GW01 19990912 51.0 3.931826
#3 GW01 19991016 60.0 4.094345
#4 GW01 19991102 86.0 4.454347
#5 GW04 19990709 104.0 4.644391
#6 GW04 19990914 102.0 4.624973
#7 GW04 19991012 84.0 4.430817
#8 GW04 19991115 72.0 4.276666
#9 GW08 19971012 31.0 3.433987
#10 GW08 19971116 84.0 4.430817
#11 GW08 19980128 65.0 4.174387
#12 GW08 19990420 41.0 3.713572
#13 GW08 20020604 51.8 3.947390
#14 GW08 20020916 57.5 4.051785
#15 GW08 20021202 66.8 4.201703
#16 GW08 20030324 87.1 4.467057
#17 GW09 19971016 59.0 4.077537
#18 GW09 19980128 85.0 4.442651
#19 GW09 19980412 75.0 4.317488
#20 GW09 19980712 99.0 4.595120
#21 GW09 20000130 75.8 4.328098
#22 GW09 20000424 82.5 4.412798
#23 GW09 20001024 85.5 4.448516
#24 GW09 20021201 188.0 5.236442
#25 GW09 20030324 150.0 5.010635
# Construct the upper simultaneous prediction limit for the
# 1of3 plan assuming a lognormal distribution for the
# sulfate data
Sulfate < EPA.09.Ex.19.1.sulfate.df$Sulfate.mg.per.l
predIntLnormSimultaneous(x = Sulfate, k = 1, m = 3, r = 2,
rule = "k.of.m", pi.type = "upper", conf.level = conf.level)
#Results of Distribution Parameter Estimation
#
#
#Assumed Distribution: Lognormal
#
#Estimated Parameter(s): meanlog = 4.3156194
# sdlog = 0.3756697
#
#Estimation Method: mvue
#
#Data: Sulfate
#
#Sample Size: 25
#
#Prediction Interval Method: exact
#
#Prediction Interval Type: upper
#
#Confidence Level: 99.97893%
#
#Minimum Number of
#Future Observations
#Interval Should Contain
#(per Sampling Occasion): 1
#
#Total Number of
#Future Observations
#(per Sampling Occasion): 3
#
#Number of Future
#Sampling Occasions: 2
#
#Prediction Interval: LPL = 0.0000
# UPL = 159.5497
#==========
# Cleanup
#
rm(dat, nc, nw, SWFPR, conf.level, Sulfate)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.