censMean.CI | R Documentation |
Computes the mean and confidence limits of left-censored data.
censMean.CI(x, method = "log AMLE", CI = 0.9, bound = c("two.sided", "upper", "lower"), alpha = 0.4)
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 |
alpha |
the offset fraction to be used, depending on |
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.
A matrix of the mean, the lower confidence limit, the upper confidence limit, and the probability represented by the confidence interval.
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.
Helsel, D.R. 2012, Statistics for censored environmental data using Minitab and R: New York, Wiley, 324 p.
censStats
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.