baytrends (version 1.1.0)

as.mcens: Multiply-censored Data Conversion

Description

Converts data to a multiply-censored data (mcens) object: various methods.

Usage

as.mcens(lower.val, upper.val, censor.codes)

# S4 method for mcens,missing,missing as.mcens(lower.val, upper.val, censor.codes)

# S4 method for lcens,missing,missing as.mcens(lower.val, upper.val, censor.codes)

# S4 method for numeric,missing,missing as.mcens(lower.val, upper.val, censor.codes)

# S4 method for numeric,numeric,missing as.mcens(lower.val, upper.val, censor.codes)

# S4 method for numeric,missing,numeric as.mcens(lower.val, upper.val, censor.codes)

# S4 method for numeric,missing,integer as.mcens(lower.val, upper.val, censor.codes)

# S4 method for numeric,missing,character as.mcens(lower.val, upper.val, censor.codes)

# S4 method for qw,missing,missing as.mcens(lower.val, upper.val, censor.codes)

# S4 method for character,missing,missing as.mcens(lower.val, upper.val, censor.codes)

Arguments

lower.val

The lower limit of the actual value, the special value of -Inf or NA can be used to indicate left-censoring. A vector of character strings is allowed when the remark code is combined with the value; blank values are treated as missing values, any other value is converted to a missing value with a warning. See Examples.

upper.val

The upper limit of the actual value, the special value of Inf or NA can be used to indicate right-censoring.

censor.codes

optional codes if upper.val is missing. Any numeric value less than 0 indicates left-censored, any value greater than 0 indicates right-censored, and 0 indicates an observed value. The character value "<" indicates left-censored, ">" indicates right-censored, any anything else indicates an observed value.

Value

An S4 object of class "mcens." These objects are the basis for the analysis of censored data that are not strictly left censored.

Details

In keeping with the logic of Surv, NA is permitted to indicate left- or right-censored data. If both are NA, then the observation is treated as missing.

References

Lorenz, D.L., in preparation

See Also

Surv

Examples

Run this code
# NOT RUN {
## Create one of each type of censoring, including uncensored
# the last value is missing
as.mcens(c(-Inf, 2, 2, 5, NA), c(1, 2, 3, Inf, NA))
# For combined remark and values:
as.mcens(c("<1", "1", ">3", "1", "2"))
# }

Run the code above in your browser using DataLab