Surv_CNSR | R Documentation |
The aim of Surv_CNSR()
is to map the inconsistency in convention between
the survival package and
CDISC ADaM ADTTE data model.
The function creates a survival object (e.g. survival::Surv()
) that
uses CDISC ADaM ADTTE coding conventions and converts the arguments to the
status/event variable convention used in the
survival package.
The AVAL
and CNSR
arguments are passed to
survival::Surv(time = AVAL, event = 1 - CNSR, type = "right", origin = 0)
.
Surv_CNSR(AVAL, CNSR)
AVAL |
The follow-up time. The follow-up time is assumed to originate from zero.
When no argument is passed, the default value is a column/vector named |
CNSR |
The censoring indicator where |
Object of class 'Surv'
The Surv_CNSR()
function creates a survival object utilizing the
expected data structure in the CDISC ADaM ADTTE data model,
mapping the CDISC ADaM ADTTE coding conventions with the expected
status/event variable convention used in the survival package—specifically,
the coding convention used for the status/event indicator.
The survival package expects the status/event indicator in the
following format: 0=alive
, 1=dead
. Other accepted choices are
TRUE
/FALSE
(TRUE = death
) or 1
/2
(2=death
).
A final but risky option is to omit the indicator variable, in which case
all subjects are assumed to have an event.
The CDISC ADaM ADTTE data model adopts a different coding convention for
the event/status indicator. Using this convention, the event/status variable
is named 'CNSR'
and uses the following coding: censor = 1
, status/event = 0
.
survival::Surv()
, estimate_KM()
# Use the `Surv_CNSR()` function with visR functions
adtte %>%
visR::estimate_KM(formula = visR::Surv_CNSR() ~ SEX)
# Use the `Surv_CNSR()` function with functions from other packages as well
survival::survfit(visR::Surv_CNSR() ~ SEX, data = adtte)
survival::survreg(visR::Surv_CNSR() ~ SEX + AGE, data = adtte) %>%
broom::tidy()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.