EventSplit: Event split with two time-scales, time and gaptime

View source: R/Event.Split.R

EventSplitR Documentation

Event split with two time-scales, time and gaptime

Description

splits after cut times for the two time-scales.

Usage

EventSplit(
  data,
  time = "time",
  status = "status",
  entry = "start",
  cuts = "cuts",
  name.id = "id",
  gaptime = NULL,
  gaptime.entry = NULL,
  cuttime = c("time", "gaptime"),
  cens.code = 0,
  order.id = TRUE
)

Arguments

data

data to be split

time

time variable.

status

status variable.

entry

name of entry variable.

cuts

cuts variable or numeric cut (only one value)

name.id

name of id variable.

gaptime

gaptime variable.

gaptime.entry

name of entry variable for gaptime.

cuttime

to cut after time or gaptime

cens.code

code for the censoring.

order.id

order data after id and start.

Author(s)

Thomas Scheike

Examples

rr  <- data.frame(time=c(500,1000),start=c(0,500),status=c(1,1),id=c(1,1))
rr$gaptime <-  rr$time-rr$start
rr$gapstart <- 0

rr1 <- EventSplit(rr,cuts=600,cuttime="time",   gaptime="gaptime",gaptime.entry="gapstart")
rr2 <- EventSplit(rr1,cuts=100,cuttime="gaptime",gaptime="gaptime",gaptime.entry="gapstart")

dlist(rr1,start-time+status+gapstart+gaptime~id)
dlist(rr2,start-time+status+gapstart+gaptime~id)


mets documentation built on May 29, 2024, 3:51 a.m.