iddata {idmTPreg}R Documentation

Transforming a Simple Illness-Death Dataset into a Proper Data Frame to be Used Inside TPreg Function

Description

Converts a raw illness-death dataset to a data frame which can be passed into TPreg function.

Usage

iddata(Stime, Sind, Iltime, Ilind, covar, ...)

Arguments

Stime

the possibly censored total survival time.

Sind

the indicator of uncensored total survival time.

Iltime

the arrival time to the intermediate state, for example diseased, recurrence, or relapse time.

Ilind

the indicator of visiting intermediate state.

covar

a vector of covariates.

...

arguments to be passed to methods.

Value

iddata returns an object of class data frame, containing at least the following components:

id

identification variable

Zt

the possibly censored sojourn time in initial state

delta1

the indicator of uncensored sojourn time in initial state

Tt

the possibly censored total survival time

delta

the indicator of uncensored total survival time

covar

a vector of covariates

Examples

Stime <- c(10, 20, 34, 12, 30)
Sind <- c(1, 0, 0, 1, 1)
Iltime <- c(7, 20, 28, 12, 30)
Ilind <- c(1, 0, 1, 0, 0)
covar <- c(20, 25, 57, 36, 46)
mydata <- iddata(Stime, Sind, Iltime, Ilind, covar)  
mydata

[Package idmTPreg version 1.1 Index]