data_survival: Data file for survival analysis

Description Usage Arguments Value Examples

View source: R/survival.R

Description

Wrapper function for data file in survival analysis.

Usage

1
data_survival(time, treatment, event, .data = NULL)

Arguments

time

vector. exposure time for the subjects. It must be the same length as the treatment variable.

treatment

vector. treatment assignment for patients, 1 for treatment group and 0 for control group

event

vector. The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For censored data, the status indicator is 0=right censored, 1 = event at time. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event.

.data

NULL. stores the survival data for analysis, please do not fill it in.

Value

a list with time, treatment, and event with time-to-event outcome.

Examples

1
2
3
data_survival(time       = c(6.2, 8.2, 8.0, 2.3),
                        treatment  = c(0, 1, 0, 1),
                        event      = c(1, 1, 1, 1))

bayesCT documentation built on July 2, 2020, 2:34 a.m.