Epi (version 0.7.0)

icut: Function to cut the follow-up in cohort at a point in time.

Description

The follow up time from enter to exit is classified as to wheter it is before cut (Time=0) or after Time=1). If cut is between enter and exit, the follow-up is split in two intervals, the first gets the value cens for the status.

Usage

icut( enter, exit, cut, fail = 0, cens.value = 0,
      data = data.frame(enter, exit, fail, cut),
      Expand = 1:nrow( data ),
      na.cut = Inf )

Arguments

enter
Date of entry. Numerical vector.
exit
Date of exit. Numerical vector.
fail
Indicator if exit status.
cens.value
Value to use for censoring status.
cut
Date where to cut follow-up. Numerical vector.
data
Dataframe of variables to carry over to the output dataframe.
Expand
Variable identifying original records.
na.cut
What value should be assigned to missing values of the cutpoint. Defaults to Inf, so the inetrmediate event is considered not to have occcurred. If set to -Inf, all persons with missing cut are conside

Value

  • A data frame with one row per interval of follow up and columns given in the data argument, preceded by the columns:
  • ExpandIdentification of the rows from the input dataframe.
  • EnterEntry date for the interval.
  • ExitExit date for the interval.
  • FailFailure indicator for the interval.
  • TimeIndicator variable for intervals after cut.

Details

The purpose of this function is to divide follow-up into pre- and post some intermediate event like recurrence of disease, thus enabling Follow-up for persons with a recurrence date (cut) will be split in two, with indication (in Time) of what is pre and what is post recurrence. This is typically what precedes a survival analysis where recurrence is modelled as a time-dependent variable.

See Also

Lexis, isec, fcut1, fcut, ex1

Examples

Run this code
one <- round( runif( 15, 0, 15 ), 1 )
two <- round( runif( 15, 0, 15 ), 1 )
doe <- pmin( one, two )
dox <- pmax( one, two )
# Goofy data rows to test possibly odd behaviour
doe[1:3] <- dox[1:3] <- 8
dox[2] <- 6
dox[3] <- 7.5
# Some failure indicators
fail <- sample( 0:1, 15, replace=TRUE, prob=c(0.7,0.3) )
# So what have we got
data.frame( doe, dox, fail )
# Cut follow-up at 5
icut( doe, dox, fail, cut=5 )

Run the code above in your browser using DataLab