predIntNormK {EnvStats} | R Documentation |
Compute the Value of
for a Prediction Interval for a Normal Distribution
Description
Compute the value of (the multiplier of estimated standard deviation) used
to construct a prediction interval for the next
observations or next set of
means based on data from a normal distribution.
The function
predIntNormK
is called by predIntNorm
.
Usage
predIntNormK(n, df = n - 1, n.mean = 1, k = 1,
method = "Bonferroni", pi.type = "two-sided",
conf.level = 0.95)
Arguments
n |
a positive integer greater than 2 indicating the sample size upon which the prediction interval is based. |
df |
the degrees of freedom associated with the prediction interval. The default is
|
n.mean |
positive integer specifying the sample size associated with the |
k |
positive integer specifying the number of future observations or averages the
prediction interval should contain with confidence level |
method |
character string specifying the method to use if the number of future observations
( |
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 |
Details
A prediction interval for some population is an interval on the real line constructed
so that it will contain future observations or averages from that population
with some specified probability
, where
and
is some pre-specified positive integer.
The quantity
is called
the confidence coefficient or confidence level associated with the prediction
interval.
Let denote a vector of
observations from a normal distribution with parameters
mean=
and
sd=
. Also, let
denote the
sample size associated with the
future averages (i.e.,
n.mean=
).
When
, each average is really just a single observation, so in the rest of
this help file the term “averages” will replace the phrase
“observations or averages”.
For a normal distribution, the form of a two-sided prediction
interval is:
where denotes the sample mean:
denotes the sample standard deviation:
and denotes a constant that depends on the sample size
, the
confidence level, the number of future averages
, and the
sample size associated with the future averages,
. Do not confuse the
constant
(uppercase K) with the number of future averages
(lowercase k). The symbol
is used here to be consistent with the
notation used for tolerance intervals (see
tolIntNorm
).
Similarly, the form of a one-sided lower prediction interval is:
and the form of a one-sided upper prediction interval is:
but differs for one-sided versus two-sided prediction intervals.
The derivation of the constant
is explained below. The function
predIntNormK
computes the value of and is called by
predIntNorm
.
The Derivation of K for One Future Observation or Average (k = 1)
Let denote a random variable from a normal distribution
with parameters
mean=
and
sd=
, and let
denote the
'th quantile of
.
A true two-sided prediction interval for the next
observation of
is given by:
where denotes the
'th quantile of a standard normal distribution.
More generally, a true two-sided prediction interval for the
next
average based on a sample of size
is given by:
Because the values of and
are unknown, they must be
estimated, and a prediction interval then constructed based on the estimated
values of
and
.
For a two-sided prediction interval (pi.type="two-sided"
),
the constant for a
prediction interval for the next
average based on a sample size of
is computed as:
where denotes the
'th quantile of the
Student's t-distribution with
degrees of freedom. For a one-sided prediction interval
(
pi.type="lower"
or pi.type="lower"
), the prediction interval
is given by:
.
The formulas for these prediction intervals are derived as follows. Let
denote the future average based on
observations. Then
the quantity
has a normal distribution with expectation
and variance given by:
so the quantity
has a Student's t-distribution with degrees of freedom.
The Derivation of K for More than One Future Observation or Average (k >1)
When , the function
predIntNormK
allows for two ways to compute
: an exact method due to Dunnett (1955) (
method="exact"
), and
an approximate (conservative) method based on the Bonferroni inequality
(method="Bonferroni"
; see Miller, 1981a, pp.8, 67-70;
Gibbons et al., 2009, p.4). Each of these methods is explained below.
Exact Method Due to Dunnett (1955) (method="exact"
)
Dunnett (1955) derived the value of in the context of the multiple
comparisons problem of comparing several treatment means to one control mean.
The value of
is computed as:
where is a constant that depends on the sample size
, the number of
future observations (averages)
, the sample size associated with the
future averages
, and the confidence level
.
When pi.type="lower"
or pi.type="upper"
, the value of is the
number that satisfies the following equation (Gupta and Sobel, 1957; Hahn, 1970a):
where
and and
denote the cumulative distribution function and
probability density function, respectively, of the standard normal distribution.
Note that the function
is the probability density function of a
chi random variable with
degrees of freedom.
When pi.type="two-sided"
, the value of is the number that satisfies
the following equation:
where
Approximate Method Based on the Bonferroni Inequality (method="Bonferroni"
)
As shown above, when , the value of
is given by Equation (8) or
Equation (9) for two-sided or one-sided prediction intervals, respectively. When
, a conservative way to construct a
prediction
interval for the next
observations or averages is to use a Bonferroni
correction (Miller, 1981a, p.8) and set
in Equation (8)
or (9) (Chew, 1968). This value of
will be conservative in that the computed
prediction intervals will be wider than the exact predictions intervals.
Hahn (1969, 1970a) compared the exact values of
with those based on the
Bonferroni inequality for the case of
and found the approximation to be
quite satisfactory except when
is small,
is large, and
is large. For example, Gibbons (1987a) notes that for a 99% prediction interval
(i.e.,
) for the next
observations, if
,
the bias of
is never greater than 1% no matter what the value of
.
Value
A numeric scalar equal to , the multiplier of estimated standard
deviation that is used to construct the prediction interval.
Note
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 (e.g., Gibbons et al., 2009; Millard and Neerchal, 2001; USEPA, 2009).
Author(s)
Steven P. Millard (EnvStats@ProbStatInfo.com)
References
Berthouex, P.M., and L.C. Brown. (2002). Statistics for Environmental Engineers. Lewis Publishers, Boca Raton.
Dunnett, C.W. (1955). A Multiple Comparisons Procedure for Comparing Several Treatments with a Control. Journal of the American Statistical Association 50, 1096-1121.
Dunnett, C.W. (1964). New Tables for Multiple Comparisons with a Control. Biometrics 20, 482-491.
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 Two-Sided Prediction Intervals for Samples from a Normal Distribution. Journal of the American Statistical Association 64(327), 878-898.
Hahn, G.J. (1970a). Additional Factors for Calculating Prediction Intervals for Samples from a Normal Distribution. Journal of the American Statistical Association 65(332), 1668-1676.
Hahn, G.J. (1970b). Statistical Intervals for a Normal Population, Part I: Tables, Examples and Applications. Journal of Quality Technology 2(3), 115-125.
Hahn, G.J. (1970c). Statistical Intervals for a Normal Population, Part II: Formulas, Assumptions, Some Derivations. Journal of Quality Technology 2(4), 195-206.
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, 178-188.
Helsel, D.R., and R.M. Hirsch. (1992). Statistical Methods in Water Resources Research. Elsevier, New York.
Helsel, D.R., and R.M. Hirsch. (2002). Statistical Methods in Water Resources. Techniques of Water Resources Investigations, Book 4, chapter A3. U.S. Geological Survey. (available on-line at: https://pubs.usgs.gov/tm/04/a03/tm4a3.pdf).
Millard, S.P., and Neerchal, N.K. (2001). Environmental Statistics with S-PLUS. CRC Press, Boca Raton, Florida.
Miller, R.G. (1981a). Simultaneous Statistical Inference. McGraw-Hill, New York.
USEPA. (2009). Statistical Analysis of Groundwater Monitoring Data at RCRA Facilities, Unified Guidance. EPA 530/R-09-007, 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/R-09-007a, August 9, 2010. Office of Resource Conservation and Recovery, Program Information and Implementation Division. U.S. Environmental Protection Agency, Washington, D.C.
See Also
predIntNorm
, predIntNormSimultaneous
,
predIntLnorm
, tolIntNorm
,
Normal, estimate.object
, enorm
, eqnorm
.
Examples
# Compute the value of K for a two-sided 95% prediction interval
# for the next observation given a sample size of n=20.
predIntNormK(n = 20)
#[1] 2.144711
#--------------------------------------------------------------------
# Compute the value of K for a one-sided upper 99% prediction limit
# for the next 3 averages of order 2 (i.e., each of the 3 future
# averages is based on a sample size of 2 future observations) given a
# samle size of n=20.
predIntNormK(n = 20, n.mean = 2, k = 3, pi.type = "upper",
conf.level = 0.99)
#[1] 2.258026
#----------
# Compare the result above that is based on the Bonferroni method
# with the exact method.
predIntNormK(n = 20, n.mean = 2, k = 3, method = "exact",
pi.type = "upper", conf.level = 0.99)
#[1] 2.251084
#--------------------------------------------------------------------
# Example 18-1 of USEPA (2009, p.18-9) shows how to construct a 95%
# prediction interval for 4 future observations assuming a
# normal distribution based on arsenic concentrations (ppb) in
# groundwater at a solid waste landfill. There were 4 years of
# quarterly monitoring, and years 1-3 are considered background,
# So the sample size for the prediciton limit is n = 12,
# and the number of future samples is k = 4.
predIntNormK(n = 12, k = 4, pi.type = "upper")
#[1] 2.698976