BinaryToCensoring {ltmle}R Documentation

BinaryToCensoring

Description

Helper function for creating censoring columns as factors.

Usage

BinaryToCensoring(is.censored, is.uncensored)

Arguments

is.censored

binary vector: 0=uncensored, 1=censored

is.uncensored

binary vector: 0=censored, 1=uncensored

Details

Exactly one of is.censored and is.uncensored must be specified as a named argument. All elements of the input vector must be 0, 1, or NA

Value

an object of class "factor" with levels "censored" and "uncensored"

Author(s)

Joshua Schwab jschwab77@berkeley.edu

See Also

factor

Examples


 BinaryToCensoring(is.censored=c(0, 1, 1, 0, NA))
 BinaryToCensoring(is.uncensored=c(1, 0, 0, 1, NA))   #the same
 
 ## Not run: 
 BinaryToCensoring(c(0, 1))   #error because the input must be named
 
## End(Not run)


[Package ltmle version 1.3-0 Index]