Cen {NADA} | R Documentation |
Create a censored object, usually used as a response variable in a model formula.
Cen(obs, censored, type = "left", ...) flip(x)
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" .
|
An object of class Cen
.
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.
Lopaka(Rob) Lee <rclee@usgs.gov>
Helsel, Dennis R. (2005). Nondectects and Data Analysis; Statistics for censored environmental data. John Wiley and Sons, USA, NJ.
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))