checkArgsEventIndicator {casebase} | R Documentation |
Check that Event is in Correct Format
Description
Checks for event categories and gives a warning message indicating which level is assumed to be the reference level.
Usage
checkArgsEventIndicator(data, event, censored.indicator)
Arguments
data |
a |
event |
a character string giving the name of the event variable
contained in |
censored.indicator |
a character string of length 1 indicating which
value in |
Value
A list of length two. The first element is the factored event, and the second element is the numeric representation of the event
Examples
if (requireNamespace("survival", quietly = TRUE)) {
library(survival) # for veteran data
checkArgsEventIndicator(data = veteran, event = "celltype",
censored.indicator = "smallcell")
checkArgsEventIndicator(data = veteran, event = "status")
}
data("bmtcrr") # from casebase
checkArgsEventIndicator(data = bmtcrr, event = "Sex",
censored.indicator = "M")
checkArgsEventIndicator(data = bmtcrr, event = "D",
censored.indicator = "AML")
checkArgsEventIndicator(data = bmtcrr, event = "Status")