cal.window: Calendar time cut of survival data

Description Usage Arguments Value Author(s) See Also Examples

Description

For a given time interval, each spell is cut to fit into the given calendar time interval.

Usage

1
cal.window(dat, window, surv = c("enter", "exit", "event", "birthdate"))

Arguments

dat

Input data frame. Must contain survival data.

window

Vector of length two: The time interval.

surv

Vector of length four giving tha names of the central variables (an "extended" Surv object) in the dataframe 'dat'.

Value

A dataframe of the same form as the input, but 'cut' as desired. Intervals exceeding window[2] are cut there and given event = 0 (censoring).

Author(s)

Göran Broström

See Also

age.window.

Examples

1
2
3
4
dat <- data.frame(enter = 0, exit = 5.731, event = 1,
birthdate = 1962.505, x = 2)
window <- c(1963, 1965)
dat.trim <- cal.window(dat, window)

goranbrostrom/eha2 documentation built on May 17, 2019, 7:59 a.m.