Learn R Programming

TPmsm (version 1.1.0)

survTP: Create a survTP object

Description

Creates a survTP object, usually used as input to other functions.

Usage

survTP(time1, event1, Stime, event, ...)
is.survTP(x)

Arguments

time1
Time of the transition into state 2, state 3 or censoring time.
event1
Indicator of transition into state 2 or state 3; 0 if the transition time is censored and 1 otherwise.
Stime
The total time of the process.
event
Censoring indicator of the total time of the process; 0 if the total time is censored and 1 otherwise.
...
Any number of covariates can be specified.
x
Any R object.

Value

  • An object of class survTP.

    survTP objects are implemented as a single element list

  • dataa data.frame with time1, event1, Stime, event and covariates as columns.
  • In the case of is.survTP, a logical value TRUE if x inherits from class survTP, otherwise FALSE.

encoding

UTF-8

Examples

Run this code
data(bladderTP)
bladderTP_obj <- with(bladderTP, survTP(time1, event1, Stime, event))
#or
bladderTP_obj <- survTP(bladderTP$time1, bladderTP$event1, bladderTP$Stime,
bladderTP$event)
data(heartTP)
heartTP_obj <- with(heartTP, survTP(time1, event1, Stime, event, age=age))
#or
heartTP_obj <- survTP(heartTP$time1, heartTP$event1, heartTP$Stime,
heartTP$event, age=heartTP$age)

Run the code above in your browser using DataLab