predict.cenfit {NADA}R Documentation

Query and Prediction with ECDFs

Description

Functions that perform query and/or prediction with empirical cumulative distribution function objects (ECDF). ECDF objects are constructed using cenfit.

mean returns the modeled mean of an ECDF. median returns the modeled median of an ECDF. sd returns the modeled standard deviation of an ECDF.

quantile produces sample quantiles corresponding to the given probabilities using an ECDF. The smallest observation corresponds to a probability of 0 and the largest to a probability of 1.

predict Predicted values based on an ECDF.

Usage

    ## S3 method for class 'cenfit':
    mean(x, ...)
    ## S3 method for class 'cenfit':
    median(x, na.rm=FALSE)
    ## S3 method for class 'cenfit':
    sd(x, na.rm=FALSE)
    ## S3 method for class 'cenfit':
    quantile(x, 
            probs=c(0.05, 0.10, 0.25, 0.50, 0.75, 0.90, 0.95),
            do.conf=FALSE, ...)
    ## S3 method for class 'cenfit':
    predict(object, newdata, do.conf=FALSE, ...)

Arguments

x, object A ECDF object constructed using cenfit
na.rm logical. Should missing values be removed?
probs Numeric vector with values in [0,1] – the quantiles to predict.
newdata Numeric vector of normalized quantiles of plotting positions.
do.conf A logical indicating if confidence intervals should be computed.
... Additional arguments passed to the generic method.

Details

Note that computed confidence intervals are set using cenfit. Thus, the confidence intervals returned in functions with the do.conf option are fixed at the value originally passed to cenfit.

Value

All functions return a numeric vector of results by default. Functions with do.conf option will return a data frame if this option is true.

Note

Some of these fuctions mask the original functions in the base package. For the documentation on the original functions use: help("foo", package="base")

Author(s)

Lopaka(Rob) Lee <rclee@usgs.gov>

References

Dennis R. Helsel (2005). Nondectects and Data Analysis; Statistics for censored environmental data. John Wiley and Sons, USA, NJ.

Dennis R. Helsel (1990), Less Than Obvious: Statistical Methods for, Environmental Science and Technology, vol.24, no. 12, pp. 1767-1774

Dennis R. Helsel and Timothy A. Cohn (1988), Estimation of descriptive statistics for multiply censored water quality data, Water Resources Research vol. 24, no. 12, pp.1997-2004

See Also

cenfit

Examples

    obs      = c(0.5,    0.5,   1.0,  1.5,   5.0,    10,   100)
    censored = c(TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE)

    mycenfit = cenfit(Cen(obs, censored)) 

    mean(mycenfit)
    median(mycenfit) 
    sd(mycenfit)
 
    quantile(mycenfit, probs=c(0.90, 0.95))
    predict(mycenfit, 1.5, do.conf=TRUE)

[Package NADA version 1.1-2 Index]