censMean.CI: Mean with Confidence Limits

View source: R/censMean.CI.R

censMean.CIR Documentation

Mean with Confidence Limits

Description

Computes the mean and confidence limits of left-censored data.

Usage

censMean.CI(x, method = "log AMLE", CI = 0.9, bound = c("two.sided",
  "upper", "lower"), alpha = 0.4)

Arguments

x

any R object than can be converted to class "lcens," or "mcens" for multiply censored data, to compute the mean. Missing values are permitted and are removed before computing the mean.

method

the method to use for computing the statistics. See Details.

CI

the minimum desired confidence interval for each level specifed in probs.

bound

a character string indicating the desired bounds, "two.sided" means the two-sided interval, "upper" means the upper bound of the interval, and "lower" means the lower bound of the interval. Only a single character is needed. The lower confidence limit is -Inf or 0 when bound is "upper" and the upper confidence limit is Inf when bound is "lower."

alpha

the offset fraction to be used, depending on method; typically in [0,1].

Details

The methods available in the current version are "log MLE," "MLE," "log ROS," "ROS," "log AMLE," and "AMLE." The methods "log ROS," "log MLE," and "log AMLE" are described by Helsel (2012) and Helsel and Cohn (1988). The methods "ROS," "MLE," and "AMLE" are similar to the previous except that no log- and back-transforms are made on the data. For "log" methods, if any value in x is negative, then a warning is generated and the returned value contains missing values.

Value

A matrix of the mean, the lower confidence limit, the upper confidence limit, and the probability represented by the confidence interval.

Note

Helsel (2012) describes computing the confidence interval for the mean of normally dsitributed data in Sections 7.4.1 and 7.4.2; those approaches are used for method "MLE" and "AMLE." Helsel (2012) describes computing the confidence interval for the mean of lognormally dsitributed data in Sections 7.5.1 and 7.5.2; those approaches are used for method "log MLE" and "log AMLE." Helsel (2012) describes bootstrapping the confidence interval for the mean when method is "ROS" or "log ROS" in Section 7.6. For this function, the number of replicates is set to a value to guarantee at least 50 replicate values lie outside of the requested confidence interval. The percentage type confidence interval is reported.

References

Helsel, D.R. 2012, Statistics for censored environmental data using Minitab and R: New York, Wiley, 324 p.

See Also

censStats

Examples


## Generate a random lognormal sample
set.seed(221)
XX.rn <- rlnorm(30)
# Compare log AMLE and log ROS
censMean.CI(XX.rn, method="log AMLE", CI=.80)
censMean.CI(XX.rn, method="log ROS", CI=.80)
# check upper bound for AMLE
censMean.CI(XX.rn, method="log AMLE", CI=.90, bound="upper")

USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.