as_Surv | R Documentation |
v_rcensored
Type to a Surv ObjectUseful for converting a v_rcensored
object into the form that is
expected as an input to various routines in the survival package. More
concretely, this function returns an object with the same form as is returned
by calling survival::Surv()
.
as_Surv(x, censor_as_event = FALSE, multiple_endpoint = FALSE)
x |
a |
censor_as_event |
an indicator for whether to treat censoring as the
event of interest (such as when estimating censoring probabilities). When
|
multiple_endpoint |
an indicator for whether to treat the outcomes as
multiple endpoint data. Otherwise all outcomes are treated as being the
same event type. Defaults to |
# Example censoring and outcome times data ctime <- v_continuous_nonneg(c(5, 6, 10, 1, Inf, 19), internal_name = "censoring") otime <- v_continuous_nonneg(c(2, 6, 11, 12, Inf, 25), internal_name = "outcomes") # Construct a `v_censored` value v <- v_rcensored( outcomes = list(ctime), censors = list(otime), end_time = 15, ) # Convert to a 'survival' package right-censored data representation as_Surv(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.