Survr: Create a survival recurrent object

View source: R/Survr.R

SurvrR Documentation

Create a survival recurrent object

Description

Creates a survival recurrent object, usually used as the response variable in a model formula.

Usage

Survr(id, time, event)

is.Survr(x)

Arguments

id

identifier of each subject; the same value for all the recurrent times of a subject.

time

gap times of recurrence. The last time of each subject is censored.

event

status indicator: 1 = recurrence, 0 = censored. Only these values are accepted.

x

any R object.

Details

Each subject must contribute one censored time (its last, incomplete gap time), so id must have exactly as many distinct values as there are zeros in event. Rows are assumed to be grouped by subject and in chronological order within subject.

Value

An object of class Survr, implemented as a matrix with columns id, time and event.

is.Survr() returns TRUE if x inherits from class Survr and FALSE otherwise.

See Also

survfitr(), psh_fit(), wc_fit(), mlefrailty_fit()

Examples

data(MMC)
x <- Survr(MMC$id, MMC$time, MMC$event)
is.Survr(x)

survrec documentation built on Sept. 22, 2026, 9:07 a.m.