Given interval breaks points, returns data frame with information on interval start time, interval end time, interval length and a factor variable indicating the interval (left open intervals). If an object of class ped is provided, extracts unique interval information from object.

int_info(x, ...)

# S3 method for default
int_info(x, min_time = 0L, ...)

# S3 method for data.frame
int_info(x, min_time = 0L, ...)

# S3 method for ped
int_info(x, ...)

# S3 method for pamm
int_info(x, ...)

Arguments

x

A numeric vector of cut points in which the follow-up should be partitioned in or object of class ped.

...

Currently ignored.

min_time

Only intervals that have lower borders larger than this value will be included in the resulting data frame.

Value

A data frame containing the start and end times of the intervals specified by the x argument. Additionally, the interval length, interval mid-point and a factor variable indicating the intervals.

See also

as_ped ped_info

Examples

## create interval information from cut points
int_info(c(1, 2.3, 5))
#>   tstart tend intlen intmid interval
#> 1    0.0  1.0    1.0   0.50    (0,1]
#> 2    1.0  2.3    1.3   1.65  (1,2.3]
#> 3    2.3  5.0    2.7   3.65  (2.3,5]

## extract interval information used to create ped object
tdf <- data.frame(time=c(1, 2.3, 5), status=c(0, 1, 0))
ped <- tdf %>% as_ped(Surv(time, status)~., id="id")
int_info(ped)
#>   tstart tend intlen intmid interval
#> 1      0  2.3    2.3   1.15  (0,2.3]