age.window: Age cut of survival data

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

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

Arguments

dat

Input data frame. Must contain survival data.

window

Vector of length two: The age interval.

surv

Vector of length three giving tha names of the central variables (a 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

cal.window.

Examples

1
2
3
dat <- data.frame(enter = 0, exit = 5.731, event = 1, x = 2)
window <- c(2, 5.3)
dat.trim <- age.window(dat, window)

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