Cen {NADA}R Documentation

Create a Censored Object

Description

Create a censored object, usually used as a response variable in a model formula.

Usage

Cen(obs, censored, type = "left", ...)
flip(x)

Arguments

obs A numeric vector of observations. This includes both censored and uncensored observations.
censored A logical vector indicating TRUE where an observation in obs is censored (a less-than value) and FALSE otherwise.
x A Cen object constructed using the Cen function.
... Additional items – none at this time.
type character string specifying the type of censoring. Possible values are "right", "left", "counting", "interval", or "interval2". The default is "left".

Value

An object of class Cen.

details

This, and related routines, are front ends to routines in the survivial package. Since the survival routines can not handle left-censored data, these routines tranparently handle ``flipping" input data and resultant calculations.

By default, Cen ``flips" the input data by subtracting a large constant that is larger than maximum input value from all observations. It then marks the data as right censored so that routines from the survival package can be used.

The function flip is provided for reversing the flip processes – ALTHOUGH all routines that accept Cen objects automatically flip resultant calculations back to the origial scale. Thus, flip should almost never be used, except perhaps in the development of an extension function.

Author(s)

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

References

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

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)

    Cen(obs, censored)
    flip(Cen(obs, censored))

[Package NADA version 1.1-2 Index]