Learn R Programming

mlt (version 1.0-2)

R: Response Variable

Description

Represent a possibly censored or truncated response variable

Usage

R(object, ...)
# S3 method for numeric
R(object = NA, cleft = NA, cright = NA,
   tleft = NA, tright = NA, tol = sqrt(.Machine$double.eps), ...)
# S3 method for ordered
R(object, cleft = NA, cright = NA, ...)
# S3 method for integer
R(object, cleft = NA, cright = NA, bounds = c(0L, Inf), ...)
# S3 method for factor
R(object, ...)
# S3 method for Surv
R(object, ...)
as.Surv(object)
# S3 method for response
as.Surv(object)

Arguments

object

A vector of (conceptually) exact measurements or an object of class response (for as.Surv) or a list.

cleft

A vector of left borders of censored measurements

cright

A vector of right borders of censored measurements

tleft

A vector of left truncations

tright

A vector of right truncations

tol

Tolerance for checking if cleft < cright

bounds

Range of possible values for integers

other arguments, ignored except for tleft and tright to R.ordered and R.integer

Details

R is basically an extention of Surv for the representation of arbitrarily censored or truncated measurements at any scale.

R applied to a list calls R for each of the list elements and returns a joint object.

Examples

Run this code
# NOT RUN {
 ### ordered factor
 R(gl(3, 3, labels = LETTERS[1:3]))

# }

Run the code above in your browser using DataLab