fillIn: Estimate Censored Values

View source: R/fillIn.R

fillInR Documentation

Estimate Censored Values

Description

Estimates values for censored data.

Usage

fillIn(x, method, alpha)

## S3 method for class 'numeric'
fillIn(x, method, alpha)

## S3 method for class 'lcens'
fillIn(x, method = "ROS", alpha = 0.4)

## S3 method for class 'mcens'
fillIn(x, method = "ROS", alpha = 0.4)

Arguments

x

an object of class "lcens." Missing values are ignored.

method

the method to use for estimating censored values: "ROS," "log ROS," "MLE," or "log MLE" are valid for any left- or multiply-censored data ; "triangular," "fill" and "log fill" are valid for left-censored data with a single detection limit; method is ignored for uncensored data.

alpha

the offset fraction to be used for plotting position; typically in [0,0.5].

Details

The methods of Regression on Order Statistics (ROS) and MLE is explained in Helsel (2012). The "log ROS" first log-transforms the data and back-transforms the estimated values. The triangular method distributes the censored value assuming a triangular distribution between 0 and the single detection limit. Quinn and Keogh (2003) describe alternatives to simple substituion of a single value that sample from an alternate distribution. The triangular distribution is a reasonable distribution when the percentage of censored data is relatively small, say less than 30 percent. The "fill" and "log fill" methods implement the method described by Gleit (1985).

Value

A vector of sorted estimates and actual values with an attribute of the censoring levels.

References

Helsel, D.R. 2012, Statistics for censored environmental data using Minitab and R: New York, Wiley, 324 p.
Quinn, G.P. and Keogh, M.J., 2003, Experimental design and data analysis for biologists, Cambridge University Press, Cambridge, UK, 539 p.

See Also

as.double.qw

Examples

set.seed(5420)
XR <- sort(rnorm(10))
XF <- fillIn(as.lcens(XR, -1)) # censors lowest 3 values
#How'd we do?
rbind(XR, XF)
#Note that this is unusual because all 10 random values were less than the mean!

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