R: Response Variable

Description Usage Arguments Details Examples

View source: R/R.R

Description

Represent a possibly censored or truncated response variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
R(object, ...)
## S3 method for class 'numeric'
R(object = NA, cleft = NA, cright = NA,
   tleft = NA, tright = NA, tol = sqrt(.Machine$double.eps), ...)
## S3 method for class 'ordered'
R(object, cleft = NA, cright = NA, ...)
## S3 method for class 'integer'
R(object, cleft = NA, cright = NA, bounds = c(min(object), Inf), ...)
## S3 method for class 'factor'
R(object, ...)
## S3 method for class 'Surv'
R(object, ...)
as.Surv(object)
## S3 method for class '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

1
2
 ### ordered factor
 R(gl(3, 3, labels = LETTERS[1:3]))

mlt documentation built on Oct. 6, 2019, 5:05 p.m.